AutoOpen Error: Assembly AUTOFAC could not be loaded from resources.

30 views
Skip to first unread message

Catalina Chi

unread,
Oct 29, 2019, 11:59:44 AM10/29/19
to Excel-DNA
Hi, I use Autofac in ExcelDNA... I actually use it in the AUTOOPEN(). I define my calculation construction logic there.  
In my Window 7 Machine, it works fine... However, when I moved to my Window 10 Machine, it will fail when I try to reload xll. 

Can someone please advise how to troubleshooting this? 

Initialization [Warning] Assembly AUTOFAC could not be loaded from resources.
Initialization [Error] DnaLibrary AutoOpen Error : TargetInvocationException - Exception has been thrown by the target of an invocation.

Capture.PNG

Caio Proiete

unread,
Oct 29, 2019, 12:06:19 PM10/29/19
to exce...@googlegroups.com
Hi Catalina,

Have you tried putting a try...catch in the `AutoOpen` method to catch the exception details and see if it gives you more information?
Also, a `TargetInvocationException` usually wraps the real exception (in the InnerException property) so I'd recommend checking that.

Anyway, if the above doesn't help and you're able to put together an example project that reproduces this error, I'm happy to help you troubleshoot the error.

Thanks,
~Caio Proiete


--
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/c4c2a667-bef9-4c3f-bd20-f6c774f70100%40googlegroups.com.

Craig Crevola

unread,
Oct 30, 2019, 12:00:56 AM10/30/19
to exce...@googlegroups.com

Hi Catalina

 

Just to check, have you referenced the library in the .dna file?

                <Reference Path="Autofac.dll" Pack="true" />

In the Autofac sample I created earlier when I removed the above line from the .dna file, I received the same error you are getting. The packed file is a stand alone distributable, so you need to ensure all of the external references/libraries are added to the .dna file so the packer can include them.

 

Thanks

 

Craig.

--

Catalina Chi

unread,
Nov 20, 2019, 6:07:15 PM11/20/19
to Excel-DNA
Thank you Craig, Caio, 
Weirdly, after restarting computer, this error no longer occur. Hence can no longer reproduce. :( 
Our new XLL (exceldna) project will go live shortly. 
I am a bit worried that same error might occur in certain user's machine. Hopefully no one will receive this error. 

To unsubscribe from this group and stop receiving emails from it, send an email to exce...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages