unload a dynamically created assembly

C

Chris Dunaway

I'm using the ICodeCompiler.CompileAssemblyFromSource method to compile a
VB class dynamically.

The problem is that when I create an instance of the resulting class, it
loads the assembly. If I have to execute this section of code more than
once, it loads the dynamic assembly each time so that I end up with more
than one of these assemblies in memory.

To unload the assembly, I found I must create another AppDomain but the
AppDomain doesn't seem to have any provision to load an assembly that was
compiled in memory.

Can anyone help with this?

Thanks,

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
C

Christian Heide Damm

The assembly must somehow be loaded in the new AppDomain, otherwise it can't
be unloaded.

Couldn't you have the new AppDomain compile the assembly?

Christian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top