简体   繁体   中英

Mixed mode assembly is built against version ‘v2.0.50727′ C# Enterprise architect add-in

I am building an Enterprise Architect add-in using C#. I have to interact with SVN Repository. I am using VS2010 and SharpSVN as library to interact with SVN Repository. my Add-in work fine when I change it to .NET 3.5. But now I have to interrogate with some another add-in and that other add-in is only compatible with 4.0.

but when I change my add-in code to .NET 4.0 then it give famous error

"Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime and need some configuration etc"

I have read here different topics about that problem and suggestion is to add app.config file. with the tags

<Configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
  <NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
</Configuration>

and same like tag this from different posts. I have tried everyone but still the problem remains. I have checked that VS2010 automatically generates the config file with the filename in Debug folder automatically.

Can anyone suggest me the solution? for example my add-in name is MyAddIn so VS2010 generates MyAddIn.dll and MyAddIn.dll.config with the above mentioned tags.

But problem remain there. I am using windows 7 64 Bit.

Any Help will be highly appreciated.

The settings in your *.dll.config is useless, and that's why you cannot get what you want. As your dll is loaded by Enterprise Architect, you will have to modify its *.app.config file to include such settings. Usually, that's not possible, as your dll is simply an add-in.

A workaround is to perform a full migration to .NET 4, which not only compiles your dll against .NET 4, but also compile all its dependencies against .NET 4.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM