A "Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information" Error Occurs When Using RepositoryAccess with .NET Framework 4.

April 6, 2011 | KB: 1012776
SDK 8.2

Summary

You may receive the following if your Visual Studio 2010 project referencing RepositoryAccess targets .NET Framework 4:

    Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

Resolution

In the app.config file for your project, add the useLegacyV2RuntimeActivationPolicy attribute to the <startup> element and set it to true. The app.config file should look similar to the following:

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

Related Links

<startup> Element

How to: Add Application Configuration Files to C# Projects