Visual Studio adding dll as a reference error

I add a library to the project and I get the following error:

The mixed-mode compilation is built against the 'v2.0.50727' version of the runtime and cannot be loaded at 4.0 time without additional configuration information.

I'm not too sure what I need to configure for this. Does anyone know what changes should be?

Thank,

PM

+2
source share
3 answers

, .NET 4 .NET 3.5 . , CLR v2, "" , CLR v4 CLR .

app.config:

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

. , .

+2

, ( MSDN)

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

, stackoverflow , google ...

From copying and pasting your error into Google: http://social.msdn.microsoft.com/Forums/en/clr/thread/58271e39-beca-49ac-90f9-e116fa3dd3c0

Good luck.

0
source

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


All Articles