Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixed mode assembly is built against old version of the runtime and cannot be loaded without additional configuration

Tags:

c#

.net

c#-4.0

I cannot build a project, written by an ex-employee, on my Windows 7 workstation. It works perfectly fine on the old XP machine he used and I have an exact copy.

Error 1 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. C:\Working\Scan\v2.5.9.99\ConfigurationTool\ConfigurationTool\SGEN ConfigurationTool

I have already searched for a solution to this error message but I have found that the solutions provided do not resolve the problem :(

This is how my config file started off, useLegacyV2RuntimeActivationPolicy is already present.

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

I have tried every suggested combination as well as different profile for full and client versions, as outlined in this thread with no results.

What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?

Has anyone got a fix or any ideas on what could be causing the difference between the copies on different machines?

like image 773
negligible Avatar asked Feb 03 '12 14:02

negligible


1 Answers

Just solved it try this:

  1. Make sure that if you have more than one project they are all set to build for .net 4 full not client.
  2. If you keep getting the compiler error set the "Generate serialization assembly" to OFF
  3. If you are building a plug-in and the output of your project is a dll you have to create a config file for that program (i had to create "INFOPATH.EXE.config")

Hope it helps

like image 87
Bobby Tables Avatar answered Oct 05 '22 12:10

Bobby Tables