1

I'm building an app on C# with .NET framework 4.5, but one of the dlls I'm using is built with .NET 2.0, so I'm trying to add mixed mode assembly functionality.

This is the error I receive: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

I tried this http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx and now my app.config looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
</configuration>

And when I run the application in visual studio, on release mode, it runs as expected, but when I try to run it in its working environment, it crashes with said error.

I tried this also [ Mixed Mode Error when building in Release Mode ] with no success.

Am I missing something else?

Community
  • 1
  • 1
desto
  • 1,047
  • 3
  • 14
  • 19
  • 1
    does the location from where you invoke your application have appname.exe.config file placed near it? Also does it run directly when you run it from the release folder itself? – Amitd Oct 16 '12 at 16:31
  • It is running on a separate directory, I copied the appname.exe.config file to the working directory and now it is running! Thanks – desto Oct 16 '12 at 17:19

1 Answers1

1

As @Amitd suggested, I copied the [appname].exe.config file to the working directory and now the app is working as expected!

desto
  • 1,047
  • 3
  • 14
  • 19