Dynamic loading/unloading of assemblies

 
 
 
Posted by:Vincentt
Data created:23 December 2014

I've made a class that inherits CuiActionCommandAdapter, I put the .dll file (and .pdb) in ...\3ds Max 2012\bin\assemblies\. It works great and I can debug it from visual studio, however I need to restart Max everytime I make a change to my dll. 

Is there a way to unload the dll and load it again once I've made my changes? Without restarting Max? 

Unfortunately, true dll unloading with .NET is not possible. However, I did manage to load new assemblies before by changing the assembly version number and making sure objects created by previous assembly have been remove from Max (unregistering all callbacks). Since CuiActionCommandAdapter is not managed by Max.NET I am not sure if that is possible.

Marsel Khadiyev (Software Developer, EPHERE Inc.)

I'm not sure if I did it correctly, but if I did it means you were right and I can't unload the dll.

I changed the assembly version from 1.0.0.0 to 2.0.0.0 and then tried to copy the newly compiled dll to the assemblies folder but it says the file is in use. I have no registered callbacks. 

 

Thanks for the reply though, restarting Max isn't too bad :)