1

Is it possible to do some CLR hosting from a managed application?

As the hosting API is exposed through COM the plumbing should be possible.

Moreover, from the 4.0 version of the runtime, it's possible to host more than one CLR in the same process.

But I'm not sure about bootstrapping a CLR from another CLR; if possible in a way as simple as the bootstrapping from native C++, without using any unmanaged code.

Any pointer is welcome, thanks.

Daniel
  • 10,864
  • 22
  • 84
  • 115
Pragmateek
  • 13,174
  • 9
  • 74
  • 108

1 Answers1

3

Limited hosting support is provided for managed code via System.AppDomainManager class. This way, you can customize some CLR behavior, such as AppDomainCreation or Security, using only C# code.

Jeffrey Richter briefly talks about this in his book CLR via C#. http://my.safaribooksonline.com/book/programming/csharp/9780735639959/clr-hosting-and-appdomains/advanced_host_control

Check the msdn page for AppDomainManager http://msdn.microsoft.com/en-us/library/system.appdomainmanager(v=vs.110).aspx

Some other links with useful info: http://blogs.msdn.com/b/shawnfa/archive/2004/11/12/256550.aspx http://blogs.msdn.com/b/shawnfa/archive/2004/11/17/259105.aspx

m_eric
  • 1,126
  • 12
  • 11
  • Thanks for your answer. AppDomainManager indeed offers some control over runtime behavior. But I was more interested in threads control, e.g. with timeouts, to illustrate the use of CER. I've finally used a native C++ host. Anyway +1 :) – Pragmateek Dec 16 '13 at 10:31