CLR Hosting, one of .net Secrets
Have you ever thought of how ASP.net works on top of IIS ?
think again, IIS is an unmanaged application while ASP.net assemblies are managed.!!!!
another example,
How MS Office and MS Visual Studio run plugins that were written in .net languages, while both office and visual studio are unmanaged applications ?
another example,
How MS Sql Server 2005 loads managed assemblies and uses them as stored procedures (SQL-CLR) ?
So, I think now you got my idea, .net framework can be used from unmanaged processes, now the question is HOW ?
The answer is that .net framework is actually developed as COM server contained in a DLL; so there are some COM interfaces defined for .net with assigned GUID's, if you want to find these GUID's and interfaces just search for the mscoree.h file, which comes with .net framework SDK.
For more details about CLR hosting on unmanaged process check
http://msdn.microsoft.com/msdnmag/issues/06/08/CLRInsideOut/#S2and also
http://msdn.microsoft.com/msdnmag/issues/06/04/Deadlocks
Stumble It!