Mixed mode error when creating in release mode

I have an asmx C # service project that has been running on framework 2 since vs 2008 Now I updated it to framework 4 on vs 2010

when I build the dll in debug mode, it compiles successfully, but when I build in the release mode, I get the following error:

Error 51 The combination of the mixed mode is built in comparison with the version "v1.1.4322" of the runtime and cannot be loaded into the runtime 4.0 without additional configuration information. C: \ Service \ MycService \ SGEN

UPDATE:   Well, I change the framework to 3.5 from the project properties, its building ok in release mode, but that the problem is in the 4.0 framework. I need it to work in framework 4.0

+5
source share
3 answers

I got the job by going to Project-> Right Click-> Properties-> Build-> Generate Serialiazation Assembly Change the value here from β€œAuto” to β€œOff” and in release mode it now works

+12
source

Do you have unmanaged code in your solution, or are you building against it?
We encountered such a problem at work when we switched to working with VS2010 and .net 4.
For us, adding the App.config file to the project, which contains the following, worked for us:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>
+1
source

You will need to put it in the configuration tag to check the link http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx , which was also present in the previous answer to the link.

0
source

All Articles