Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run vs2005 c++ project in later version of visual studio

I have a C++/CLI project that was created in VS2005. I'm hoping to run this in VS2010 (or 2012) as that is my main IDE and I need to modify some things in the C++/CLI project as well and its irritating to have to switch back and forth to vs2005 to recompile, copy etc. The other important reason is my projects running in VS2010/2012 are in .NET4 so there is no option to move everything on to VS2005.

The project has dependencies on unmanaged third party libraries that themselves have dependencies on the debug versions of the c++ redistributable libraries (msvcr80.dll, msvcm80.dll, msvcp80.dll)

When I first ran the upgraded project I received 'specified module could not be found' -

It was then I noticed the cli project is being compiled against the later versions of msvc (msvcr90.dll)

cli assembly dependencies as per depends; vs2005 on left vs 2008 on right

enter image description here

Is there any way to make a later version of VS compile using the 2005 libraries?

update its not vital which one it compiles against (and may not be possible anyway) but is it possible to run and debug both side by side? When I try to run the compiled project I get this error message:

enter image description here

I've tried copying the manifest file from the vs2005 project to the vs2010 project but this does not work (same error message). I also disabled the embedded manifest and replaced the generated .manifest file with the one from vs2005 and this does not work either.

update2 I've got past this error by specifying the msvcr libraries in the manifest:

<dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>

however now when I run my application one of the third party libraries throws an AccessViolationException - Attempted to read or write protected memory when I try to use one of the methods. This code otherwise works fine in vs2005.

like image 555
wal Avatar asked Oct 03 '22 23:10

wal


1 Answers

I have since discovered Daffodil for Visual Studio which does exactly what I need, namely compile against vc80 in visual studio 2010. After installation the Platform Toolset dropdown gets a few more options:

nb, you still need to have the relevant version of Visual Studio installed, eg if targeting vc80 you need vs2005. nb2, Intellisense is broken in vs2010 for cli/c++ which is a major letdown after the amount of time researching getting the project to work on vs2010

enter image description here

like image 129
wal Avatar answered Oct 13 '22 11:10

wal