Specify .net version for COM+ components (dllhost.exe)

Last Thursday (13/11/2008), I reinstalled Visual Studio 2008 and sudeenly, all data access layer components which were COM+ did not work. WIth the help of other developers, the issue was tracked down that they were loaded into .Net framework 2.0. They were written in .Net 1.1 and should run in 1.1 context though. For some reason, COM+ components were loading into .Net 2.0 by default. SysteInternal’s FileMon was really handy in tracking down this issue.

We asked google about fixing .Net version for COM+ and there was a post about it. It was a short writing but has everything I need.

.Net: Run .Net 1.1 COM+ Serviced Components Under .Net 2.0 Framework

I created a config file for dllhost.exe
The content of the file is like this.

<?xml version ="1.0"?>
<configuration>
    <startup>
        <requiredRuntime version="v1.1.4322" safemode="true" />
        <supportedRuntime version="v1.1.4322" safemode="true" />
     </startup>
</configuration>

And all .Net COM+ components started working again like a magic! Hope this helps to anyone who read this post.

Specify .net version for COM+ components (dllhost.exe)