Since upgrading to ExcelDNA 0.32.26.1 from 0.30.22.1, we've been getting crashes when using bool parameters. It's quite easy to reproduce - using Excel 2013 (or probably any other version?), just define a function like this:
[ExcelFunction(IsExceptionSafe = true)]
public static object MyTestFunction(bool testParam)
When you call it with one of these, where A1 contains a div by zero error:
You sometimes get a NullReferenceException in one of ExcelDNA's wrapper functions, but either way Excel crashes. You can get round it by either using an object parameter or by marking it not Exception-safe.
Is there anything we can do about this? It looks like the code in XlBooleanMarshaler.MarshalNativeToManaged is returning null on purpose, but I guess some code elsewhere isn't handling it.