Advertisement
C_Volume2 Miscellaneous #84881

Load and unload Assemblies

Ok what this example does is load a DLL that has a form called Form1 (yea I know that isn't creative) and show it to the user. Then you can unload the DLL and it unlocks the DLL. You see when using the createinstance of an assembly it will load that instance into the current appdomain. Once it's loaded and created it then locks the assembly (the dll or exe). You have to completly quite the application in order to delete the DLL. This project allows you to load an assembly and use a class then unload it without ending the entire application. I needed this in order for my dynamicly compiled forms to work, you see if I compiled at runtime a form and viewed it it would lock the DLL, then when I recompiled it I would get a lock error. Even though I closed the form I pulled from the DLL. So this method allows me to view then unload then recomile then view to my hearts desire. Hope this is useful to others. Please Vote I looked everywhere for an answer to this problem and they where slim to none, not one example in VB.net and the ones in C# where really bad most of the time.

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
Upload
Původní komentáře (3)
Obnoveno z Wayback Machine