1

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.

Nikhil
  • 16,194
  • 20
  • 64
  • 81
Tahir Nazir
  • 73
  • 1
  • 8

1 Answers1

3

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.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • I have tried to compile it against .NET 4.0 and it get compiled but when I access my add-in in Enterprise Architect then it at run time it give this "Mixed mode assembly is built against version ‘v2.0.50727′" error Any solution to this problem will be highly appreciated. – Tahir Nazir Nov 06 '12 at 03:06
  • When you said "it", please re-read what I have typed. In short, all dependencies (references) it links to also need to be recompiled against .NET 4. – Lex Li Nov 06 '12 at 05:50