CLR hosting from managed code?

612 Views Asked by At

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.

1

There are 1 best solutions below

1
m_eric On

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