Hi Enrico,
For the case where you’re debugging the add-in from Visual Studio, it should just work fine with the extra dependency.
Can you see that it is copied correctly to the output directory?
For the ‘packed’ version of the add-in (which you see in the ‘publish’ subdirectory of the output) you might need an extra step.
If you are targeting .NET Framework 4.x, you need to add an entry in the .csproj project file like
<PropertyGroup>
<ExcelAddInInclude>MyLibrary.dll</ExcelAddInInclude>
</PropertyGroup>
(The property is a semicolon separated list of references.)
If you are targeting .NET core (.NET 6+) this should not be needed – we pick up the dependencies from the .deps.json file automatically.
If it’s still not working, check in the debug output is you can see any load errors there.
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/exceldna/d83832b1-02c2-4660-a02a-616fbd8895edn%40googlegroups.com.
You can change your target framework to "net472" or "net48" to target .NET Framework if you'd like.
Error you describe might be if you target "net6.0" instead of "net6.0-windows”. That's what the VS project template starts with, but it then doesn't know what version of the Excel-DNA assembly to use until you add the windows specifier.
-Govert
To view this discussion visit https://groups.google.com/d/msgid/exceldna/7fc6a742-2b89-4aa6-80aa-ea9c223d9947n%40googlegroups.com.