views:

73

answers:

2

I'm fiddling with a project where the CLR is hosted within a C application. Is there a supported way to unlink the CLR and relaunch it?

+3  A: 

Instead of trying to reload the CLR, you could load and host all of your information in an AppDomain you create.

You could then manage the life of the AppDomain, including unloading the entire AppDomain and loading a new one.

This will provide most of the benefits that reloading the CLR would provide, without actually trying to unload the CLR.

Reed Copsey
+1  A: 

I don't have the book before my right now, but I believe (accroding to Customization the Common Language Runtime) it is not possible to do that. You can unload, i.e. "disable" it, but then you cannot reload it in the same process instance.

Christian.K
That's true and it's a pain (especially for unit testing CLR hosting code!)
Len Holgate