Ins & Outs of hostable web core
[DllImport(@"%windir%\system32\inetsrv\hwebcore.dll")]
Each instance of HWC requires its own applicationHost.config file which must conform to following restrictions.
è Your process will act as the worker process. As there is only one process involved, appHostConfigPath can have only 1 application pool definition.
o If appHostConfigPath has multiple application pools defined in it, this method will fail with error 0x80070038.
Note that WebcoreActivate and WebcoreShutdown can be called only once in process lifetime. Also HWC always uses .Net 2.0 schema and there is no way to make it pick .Net 4.0 schema. So root web.config passed to WebcoreActivate cannot have properties which are only supported in .Net 4.0. This problem will be fixed in Win8.