Problem with Build in release mode C #

1

When attempting to build release mode release displays the following error message:

  

The mixed-mode assembly has been compiled against the runtime version 'v2.0.50727' and can not be loaded at runtime 4.0 without additional configuration information.

On the file: SGEN

Build in debug mode works without problems.

Anyone know what I can do?

    
asked by anonymous 24.04.2015 / 16:17

3 answers

4

In App.config:

<startup>
...
</startup>

Change to:

<startup useLegacyV2RuntimeActivationPolicy="true">
...
</startup>
    
02.07.2015 / 19:33
3

Because of parallel runtimes support, version 4.0 of the .NET platform has changed the way the framework binds to mixed-mode old assemblies ( mixed mode ).

These assemblies are, for example, those that are compiled from C ++ \ CLI. (DirectX assemblies are also available in mixed mode.) If you see this message, you will know that this is the cause of your problem:

  

The mixed-mode assembly was compiled against the   'runtime v2.0.50727' and can not be loaded in runtime   running 4.0 with no additional configuration information.

If you want to return to the binding mode used in .NET 2.0, add the following flag to your app.config file:

<startup useLegacyV2RuntimeActivationPolicy="true">
</startup>

Source:

F # Scripting, .NET 4.0 and Mixed-mode assemblies , Jomo Fisher

    
01.10.2015 / 14:40
0

In the project options in the Build tab. In the "Generate serialization assembly" option leave as auto.

    
24.04.2015 / 17:24