NET8 and failure to load assembly

Skip to first unread message

Henrik Teneberg

Jun 3, 2024, 6:45:20 AMJun 3
to Excel-DNA

I am in the process of upgrading my 32-bit addin from .NET6 / ExcelDNA 1.6.0 to NET8 / ExcelDNA 1.8.0.

Essentially, I have a "loader addin" that loads another addin dynamically, where the idea is to have the loader addin static and change only for .NET upgrades, and the dynamically loaded addins can change at any time.

I have done the following:
1. Installed .NET8 SDK and desktop runtime 32 and 64 bit
2. Upgraded ExcelDNA from 1.6.0 to 1.8.0
3. Upgraded both my addins from NET6 to NET8

After step 2 everything still works as normal, but after step 3, loading of the dynamically loaded addin fails (the call is XlCall.Excel(XlCall.xlfRegister, xllFile);) with the following error (read via image textreader):

Assertion failed!
File: ...\ExcelDna.Host\host-.cpp
Line: 64
Expression: load_assembly_and_get_function_pointer !=
nullptr  && "Failure: get_dotnet_load_assembly()

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)

I have looked in host.cpp in Github (master branch, as I dont seem to find a 1.8.0 tag), but I do not get much wiser.

What can be the source of this issue? What more can I investigate on my side?

Thanks in advance

Govert van Drimmelen

Jun 4, 2024, 8:03:01 PMJun 4
to Excel-DNA
Hi Henrik

Is your Excel installation 32-bit or 64-bit?

The Excel-DNA build task ensures that the right version of the (loader) add-in loads when debugging, but you'll have to do this yourself for the subsequently loaded add-ins.

From your error message it looks like you're loading the 32-bit version.


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
To view this discussion on the web visit

Henrik Teneberg

Jun 5, 2024, 3:56:56 AMJun 5
to Excel-DNA
Hi Govert,

Thank you for your reply!

No, I am using Excel 32-bit and <ExcelDnaCreate64BitAddIn>false</ExcelDnaCreate64BitAddIn> so that was not the problem.

However, your reply had me thinking a second round, and I realized I had forgotten to update the generic xll and dna, that the host addin uses to dynamically load the inner addin (which is shipped as a library only), to 1.8.0 versions. Those are not produced automatically by the build task, but rather shipped as a separate zip file. Updating those solved the problem.

Reply all
Reply to author
0 new messages