More on .NET 2.0 - 1.1 on the same machine

I did a little more digging into the SMTP sink issue I was having the other day. It seems that inetinfo.exe doesn’t load the .NET framework into itself right away, but instead the issue is that it calls my managed event sinks via .NET COM interop.

You see, when Interop loads an assembly, it loads it using the newest version of the .NET framework that is available. So once I installed .NET 2.0 onto the machine, the COM interop code was loading my managed sinks into that version and causing me all those troubles.

Now, you can define which version of the .NET framework you explicitly want loaded in the app.config file, like so:

XML:
<?xml version="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v1.1.4322" />
        <supportedRuntime version="v1.0.3705" />
        <requiredRuntime version="v1.1.4322" />
    </startup>
</configuration>

Anyway, by the time I found it, it was too late for me… I’d already re-written my serialization to use our version-independent code. At least I can slowly update things to .NET 2.0 without any other problems, now though!