After upgrading existing DotNet 2.0 or 3.5 application to DotNet 4.0, you might see following error message
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.
To fix this issue, put a config file next to your exe called <exename>.exe.config with the following content:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Or if your exe already has config file, just append following <startup> element to config file.
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
If your exe already has config file, just append following <startup> element to config file.
If you really want to knon more detail, check out Mark Miller’s post What is useLegacyV2RuntimeActivationPolicy for?