The mixed mode combination is built on the old version of the runtime and cannot be loaded without additional configuration

I can’t create a project written by a former employee on my Windows 7 workstation. It works fine on the old XP machine that it used, and I have an exact copy.

Error 1 The mixed-mode assembly is based on the runtime version v2.0.50727 'and cannot be loaded into runtime 4.0 without additional configuration information. C: \ Work \ Scan \ v2.5.9.99 \ ConfigurationTool \ ConfigurationTool \ SGEN ConfigurationTool

I was already looking for a solution to this error message, but I found that the solutions provided do not solve the problem :(

So my configuration file began, now the parameter LegacyV2RuntimeActivationPolicy is used.

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

I tried each offered combination, as well as a different profile for the full and client versions, as indicated in this thread without any results.

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

Does anyone have a fix or any ideas on what might cause the difference between the copies on different machines?

+6
source share
3 answers

Just decided that try this:

  • Make sure that if you have several projects, they are all set up to create a complete non-client for .net 4.
  • If you continue to receive a compiler error, set Generate Serialization Build to OFF
  • If you are creating a plug-in and the output of your project is dll, you need to create a configuration file for this program (I had to create "INFOPATH.EXE.config")

Hope this helps

+6
source

For us, this topic helped: http://social.msdn.microsoft.com/Forums/en/clr/thread/2a5bf31e-df96-4bf1-a846-699da46b62fb

“Create assembly of assemblies” was set to AUTO, and we were not comfortable disabling it if VS (in release mode) tried to generate it. What the stream told us was that sgen.exe might be (and might already have been), it says "useLegacyV2RuntimeActivationPolicy" just like we tried to do in our own app.config. Pretty obscure.

0
source

I tried using the following code works for me: both build versions 2 and 4

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

this can help

0
source

Source: https://habr.com/ru/post/907574/


All Articles