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?
Asked
Active
Viewed 296 times
1
-
Why do you want to reload? In the IIS model, the unit of reloading/recycling is the worker process itself. I don't know about SQLCLR, but I suspect there's something more interesting there. – Cheeso Nov 26 '09 at 01:02
2 Answers
3
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
- 554,122
- 78
- 1,158
- 1,373
1
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
- 47,778
- 10
- 99
- 143
-
That's true and it's a pain (especially for unit testing CLR hosting code!) – Len Holgate Sep 23 '10 at 09:20