Friday, 28 January 2011

Running mixed mode assemblies

If your running .net 4.0 and you have a dependency on a lower version assembly (in my case 2.X) you might get this error

FileLoadException was unhandled
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.

This can be fixed obviously by building the dependency to 4.0 or with this config (if you don't have control of the assembly as in my case)

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

key config is useLegacyV2RuntimeActivationPolicy="true"

(under <configuration> )

No comments:

Post a Comment