Dot-Net

將 c++ 項目從 4.0 轉換為 3.5 框架

  • April 24, 2012

我必須將 c++ 項目的目標框架從 4.0 更改為 3.5。我發現這個問題/答案有助於如何做到這一點:Change C++/CLI project to another framework than 4.0 with vs2010

我遇到了以下問題:我收到警告:

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

, 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和 也是如此System.Data.SqlXml, Version=4.0.0.0。這會導致依賴於無法找到的 file.dll 的所有項目中出現錯誤。

我不知道如何解決這個問題。我也安裝了 Visual Studio 2008 - 儘管它似乎並不在意,並且使用 Platform Toolset v90 甚至無法建構 c++ 項目。請幫忙 !

Visual C++ 編譯器版本 16.00(隨 Visual Studio 2010 提供)不能針對 4.0 以外的任何框架版本。

要面向 3.5,您必須使用舊版 (Visual Studio 2008) 的 C++ 編譯器,並且您將無法使用新的 C++ 語言功能(例如初步的 C++11 支持)。

通過選擇平台工具鏈 v90,您可以繼續使用 Visual Studio 2010 IDE。

引用自:https://stackoverflow.com/questions/10306363