Build problem in C#release mode

Asked

Viewed 2,501 times

1

While trying to build release mode displays the following error message:

Mixed mode Assembly has been compiled relative to 'v2.0.50727' version of runtime and cannot be loaded at runtime 4.0 without additional configuration information

In the archive: SGEN

Build in debug mode works smoothly.

Does anyone have any idea what I can do?

  • Get a look at this link.http://www.davidmoore.info/blog/2010/12/17/running-net-2-runtime-applications-under-the-net-4-runtime/

  • I had already looked at this link, but it didn’t solve. vlw

  • Solution: https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx

3 answers

4

In App.config:

<startup>
...
</startup>

Modify to:

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

3

Because of the support to runtimes in parallel, version 4.0 of the . NET platform changed the way the framework binds to old mixed mode 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:

Mixed mode Assembly has been compiled relative to the version 'v2.0.50727' of the runtime and cannot be loaded at the time of execution 4.0 without 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

0

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.