Assembly not loading properly

Assembly not loading properly

MGO-Norsyn
Advocate Advocate
246 Views
1 Reply
Message 1 of 2

Assembly not loading properly

MGO-Norsyn
Advocate
Advocate

I am loading an assembly using Assembly.LoadFrom(etc...).

The assembly is loading seemingly fine, I don't receive any errors, but the code in the public void Initialize() never runs!

And the commands defined in the assembly do not become available.

 

Please help, I don't know how to debug such a situation. The loading of assembly worked before, but then just stopped working. It also works on another computer. So it is a local problem on this machine. I did a clean reinstall of windows 11 just recently.

0 Likes
247 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor

In the past I did run into issues with Assemly.Load()/LoadFrom(), but could not recall the details by now.

 

You might want to use Autodesk.AutoCAD.Runtime.ExtensionLoader.Load() to load DLLs, instead of Assembly.LoadXxx(). It is AutoCAD .NET API that wraps Assembly.LoadXxxx(), which may provide more robust way of loading .NET DLLs into AutoCAD process. Since this ExtensionLoader available (since Acad2013?), I only use this to dynamic load DLLs when needed.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes