Runar Ovesen Hjerpbakk

Software Philosopher

Error loading mixed mode assembly

Referencing a .N2.0 assembly from my .Net 4.0 client profile application today I encountered this error:

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.

What is this additional configuration information? Add

useLegacyV2RuntimeActivationPolicy="true"
to the app.config-file. Example:
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>

For more information, see this excellent post.