Click to See Complete Forum and Search --> : Using assemblies compiled against version 2.0.50727 with v4.0


pankaj227
August 20th, 2010, 01:45 AM
Hi,

My Visual C++ 2010 project uses an assembly (dll) which is compiled against v2.0.50729 of CLR. When I target the project for DotNet Framework 4.0, I get the following error message:

Mixed mode assembly built against version v2.0.50727 of the runtime cannot be loaded in the 4.0 runtime without addition configuration information.

I understand that the runtime policy for DotNet Framework is causing this error. I added app.config file to the VC++ project and edited the startup tag like this:

<startup useLegacyV2RuntimeActivationPolicy="true">

but this doen't solve the problem. I guess that the VC++ project is not picking up the app.config file.





Is there anything wrong that I am doing? Any known issues with VC 2010. The same thing works fine for VC# 2010.

pankaj227
August 23rd, 2010, 03:29 AM
I am able to solve the above problem by renaming app.config file to EXENAME.exe.config and placing it in the Debug / Release directory. For example if the application name is app.exe the config file name should be app.exe.config.