轉VS2010解決方案轉換到VS2008

如果你使用VS2010的任何版本寫代碼,那麼在VS2008中就不能打開VS2010的解決方案了,爲此,通過以下三步就可以解決了
一.對於工程名.sln;
 1.用你喜歡的編輯器打開sln文件,比如notepad++

 2.找到下面的字符串
Microsoft Visual Studio Solution File, Format Version 11.00.
# Visual Studio 2010. 
並且用下面的字串替換
Microsoft Visual Studio Solution File, Format Version 10.00. (I)
# Visual Studio 2008. (II, 可選)
二.對於工程名.csproj/vbproj
1.用你喜歡的編輯器打開這個工程文件

2.找到下面的字符串
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">.
然後用下面的字符串來替換
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">. (III)

就這樣了
現在你就可以在VS2008中打開了,反正也可以通過反着改一下就可以讓VS2008的項目在VS2010中打開了

三.做完這些改變後,可能會出現這樣的錯誤

-------------------------------------------------------------------
Microsoft Visual Studio
---------------------------
Unable to read the project file 'XXX.csproj'. 

C:\Project path\XXX.csproj(89,11): The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
---------------------------
OK Cancel 
------------------------------------------------------------------
爲了修正這個錯誤,只要的工程名.csproj/vbproj文件中找到上面的字符串,把v10.0改成v9.0.就好了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章