How to unload Application DLL file

How to unload Application DLL file

Anonymous
Not applicable
5,235 Views
7 Replies
Message 1 of 8

How to unload Application DLL file

Anonymous
Not applicable

Hi Friends,

 

Ihave made the .NET application with class library which provide us Application DLL file which will used to do our customization.

 

Once I have loaded my DLL and after that if I make change any thing in the Code and than I rebuilt it, I am getting the following error message:

 

Error    15    Unable to copy file "obj\Release\SemiAuto.dll" to "bin\Release\Test.dll". The process cannot access the file 'bin\Release\Test.dll' because it is being used by another process.   

Error    14    Could not copy "obj\Release\Test.dll" to "bin\Release\Test.dll". Exceeded retry count of 10. Failed.    SemiAuto

 

0 Likes
5,236 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

There is no way to unload DLL . Once you load the DLL into AutoCAD, it will be locked then by AutoCAD. You have to close AutoCAD to build that again.

 

Regards

Zakir

Message 3 of 8

Anonymous
Not applicable

Every time close and open  that's not a best practice right.

0 Likes
Message 4 of 8

fieldguy
Advisor
Advisor

I use the netreload utility provided by artvegas (thanks again!).

 

https://forums.autodesk.com/t5/net/net-reload-utility-for-visual-studio-download-here/m-p/3185104#M2...

0 Likes
Message 5 of 8

dgorsman
Consultant
Consultant

It's not ideal if you use the "hack'n'slash" approach to development i.e. using debugging to figure what code to write next or what logic/program flow to use.

 

It's not that bad if you change to a more structured approach I.e. working out the data structure and program flow first, using good programming practices, Intellisense, etc. to avoid pitfalls.  That way debugging is little more than confirmation of program logic and won't generate a lot of changes.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 6 of 8

JamesMaeding
Advisor
Advisor

@Anonymous

You have hit one of the major differences between lisp and .net development.

Yes, its a pain in the but stopping and starting a session for every code edit.

At a minimum, set up a script (.scr file) to load the .net assembly you are testing, and set your startup params in debug to load that script, to avoid the netload command once each session opens.

Do not use autoload reg settings for this, you just want the debug dll load when testing.

script might be:

netload
"C:\Programming\DotNet\myprog\bin\Debug\RB18\myappR18.dll"

 

then command line debug params like:

/nologo /p "<favorite profile...>" /product ACAD /language "en-US" /b "C:\Programming\DotNet\myprog\Load 2018.scr"

 

The idea with .net is you try to get code in order more before debug. For years autodesk has said we would have "edit and continue" but it never happened, and we "git what we git" as is the new autodesk mantra.

Still, I prefer .net to lisp as visual studio is so nice to use, and object structure of .net is next gen.

 

 


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

0 Likes
Message 7 of 8

luiscruzrodriguez20
Community Visitor
Community Visitor

I personally have AutoCAD run in debug mode when i run my application. and when i make a change to the program I just click on hot reload. it works fine but if you make really big changes it might ask you to close Cad in order to build.

Message 8 of 8

joseguiaCES
Participant
Participant

same - was a bit leery of using it, but for small edits it seems to be working fine.

0 Likes