Book a Demo

Author Topic: Mixed mode assembly is built against version v2.0  (Read 5931 times)

Tahir Nazir

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Mixed mode assembly is built against version v2.0
« on: November 06, 2012, 02:17:40 pm »
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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Mixed mode assembly is built against version v
« Reply #1 on: November 06, 2012, 06:14:52 pm »
Sorry, I don't really have a clue.
I've built numerous add-ins in .Net 4.0 and I've never had such an issue.
Have you tried starting all fresh to see whether you still have the issue?

Geert

Shaggy Man

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Mixed mode assembly is built against version v
« Reply #2 on: November 07, 2012, 12:55:52 am »
How about using EA.exe.config for the name of app.config instead of MyAddIn.dll.config?

or

Install .Net 3.5 Library ?

Tahir Nazir

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Mixed mode assembly is built against version v
« Reply #3 on: November 07, 2012, 06:30:38 am »
thnx a lot. it worked.......

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Mixed mode assembly is built against version v
« Reply #4 on: November 07, 2012, 07:35:49 pm »
Quote
thnx a lot. it worked.......
What worked?  Which of the possible solutions worked?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Tahir Nazir

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Mixed mode assembly is built against version v
« Reply #5 on: November 09, 2012, 12:20:28 pm »
Quote
Quote
thnx a lot. it worked.......
What worked?  Which of the possible solutions worked?

Paolo

EA.exe.Config worked....