Could not load file or assembly 'ExcelDna.Loader'

195 views
Skip to first unread message

Doug Robertson

unread,
Sep 24, 2020, 5:50:00 PM9/24/20
to Excel-DNA
I am suddenly seeing an error pop up and I am hoping someone can help me out.

An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll and wasn't handled before a managed/native boundary
Additional information: Could not load file or assembly 'ExcelDna.Loader' or one of its dependencies. The system cannot find the file specified.

If I push past this I also get;

An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll but was not handled in user code
Additional information: Could not load file or assembly 'ExcelDna.Integration, Version=1.1.0.0, Culture=neutral, PublicKeyToken=f225e9659857edbe' or one of its dependencies. The system cannot find the file specified.

I have reinstalled ExcelDNA. Everything seems to be fine as far as references are concerned.

I am not sure what is going on.

Govert van Drimmelen

unread,
Sep 24, 2020, 6:09:33 PM9/24/20
to exce...@googlegroups.com

Hi Doug,

 

This sounds really strange. Did you change something in your project recently?

Are you using the ExcelDna.AddIn package from NuGet – is that what you mean by “reinstalled ExcelDNA”?

 

I would suggest starting with a brand new project, making sure you pick the Class Library (.NET Framework) template, and then install the ExcelDna.AddIn package from NuGet into the project.

From there you can add a small ‘public static’ test function like the example in the readme, and press F5 to build and load in Excel.

This should work fine, and then you can start to figure out how the working project differs from the problem one.

 

-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 on the web visit https://groups.google.com/d/msgid/exceldna/8c92379f-e1dd-48f8-a669-6cabcc700b0en%40googlegroups.com.

Doug Robertson

unread,
Sep 24, 2020, 6:29:42 PM9/24/20
to Excel-DNA

Sorry, I should have been more specific.

Yes, I am using the nugget packages;
ExcelDNA.AddIn v1.1.1
ExcelDNA.Integration v1.1.0
ExcelDNA.Intellisense v1.3.0

I will test vs a small project to see if that works.

This current project is actually quite mature and has been running well for nearly a year. This error just popped up.

Let me see if I can dig up more details

Doug Robertson

unread,
Sep 30, 2020, 10:33:14 AM9/30/20
to Excel-DNA
To wrap this up, I did find the issue. In case anyone encounters a similar problem, here was my resolution.

I had two projects in the overall solution that were related to the problem. One project was the XLL add-in and the second was a COM add-in that was distributed by VSTO.

The VSTO project was part of distributing the rest of the add-in files and registering parts of the XLL. This project required that the ExcelDNA DLLs be copied locally and distributed as part of the VSTO install. The XLL project on the other hand had all the DLLs in the packed distribution XLL.

My core mistake was adding the ExcelDNA.AddIn Nuget to the VSTO Com AddIn project. For some reason, this blocked the ExcelDNA DLLs from being copied locally despite their property settings being configured to do so.

The resolution was to remove the ExcelDNA AddIn Nuget from the COM AddIn and replace it with the ExcelDNA.Integration Nuget. Once I did this, the required DLL files were copied into the correct location and the system once again worked.
Reply all
Reply to author
Forward
0 new messages