Convert c++ project from 4.0 to 3.5 framework
Asked Answered
S

1

7

I have to change the targeted framework of a c++ project, from 4.0 to 3.5. I have found this question/answer helpful in how to do it: Change C++/CLI project to another framework than 4.0 with vs2010
I run into the following problem though: I am getting warnings:

 warning MSB3258: The primary reference "path\file.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework

and the same for System, Version=4.0.0.0, Microsoft.VisualC, Version=10.0.0.0, System.Configuration, Version=4.0.0.0, System.Xml, Version=4.0.0.0, System.Security, Version=4.0.0.0, and System.Data.SqlXml, Version=4.0.0.0. This results in errors in all projects that depend on the file.dll which cannot be found.
I don't know how to fix this. I have Visual Studio 2008 installed as well - though it doesn't seem to care, and using Platform Toolset v90 makes even the c++ project not build. Please help !

Smokeless answered 24/4, 2012 at 21:36 Comment(2)
Do you have 3.5 framework installed? microsoft.com/download/en/details.aspx?id=21Pisano
yes, and all the dot net applications I have work fine with 3.5, except for those that depend on the one I am trying to fixSmokeless
P
10

The Visual C++ compiler version 16.00 (shipped with Visual Studio 2010) is not capable of targeting any framework version other than 4.0.

To target 3.5, you must use the older (Visual Studio 2008) version of the C++ compiler, and you will not be able to use new C++ language features (such as preliminary C++11 support).

You can continue to use the Visual Studio 2010 IDE, by selecting the platform toolchain v90.

Peatroy answered 24/4, 2012 at 21:52 Comment(1)
I have been trying to troubleshoot the following item included in an .rc file, which apparently is not included with VS2008 Express: #include "afxres.h". I found that it can be replaced with windows.h, but I am not sure that it will work correctly. In VS2010, it was able to find the afxres.h file.Smokeless

© 2022 - 2024 — McMap. All rights reserved.