Description
Using params object[] together with [return: ExcelHandle] causes Excel-DNA startup to fail.
This minimal example reproduces the issue:
using ExcelDna.Integration;
public static class TestFunctions
{
[return: ExcelHandle]
[ExcelFunction]
public static object CreateHandle(
object value,
params object[] values
)
{
return new object();
}
}
Excel-DNA throws the following exception during initialization:
Initialization [Error] Integration.DnaLibraryAutoOpen Error :
NotSupportedException -
A non-collectible assembly may not reference a collectible assembly.
Removing params fixes the issue:
using ExcelDna.Integration;
public static class TestFunctions
{
[return: ExcelHandle]
[ExcelFunction]
public static object CreateHandle(
object value,
object values
)
{
return new object();
}
}
Environment
- Excel-DNA: 1.10.0-preview4
- .NET: net8.0-windows
- Excel: Microsoft 365
- Platform: x64
- OS: Windows 11
Description
Using
params object[]together with[return: ExcelHandle]causes Excel-DNA startup to fail.This minimal example reproduces the issue:
Excel-DNA throws the following exception during initialization:
Removing
paramsfixes the issue:Environment