Mixed mode assembly in .NET 4

The best would probably be to recompile your class library for .NET 4.0 in Visual Studio 2010 (ie. opening up the project, converting it, and changing the target framework.)

If you can’t, or won’t, do that, then you can try adding the following to your app.config file for your .NET 4.0 application:

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
</startup>

ie.

<?xml version ="1.0"?> 
<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0"/>
    </startup>
</configuration>

Leave a Comment