我正在運行VS 2010,我有一個最初設置爲.NET 4.0的項目。 .NET的這個版本對於這個應用程序預計可以運行的許多Windows平臺來說太高了,所以我將它從.NET 4.0切換到了.NET 2.0。現在,該項目不會建立。切換目標.NET版本,現在項目不會生成
起初,我得到了項目資源的空引用異常。我在MSDN論壇上發現了this link,證明它有助於解決該問題。從本質上講,是工作的答案(許多之中)是改變的所有實例:
Version=4.0.0.0
到
Version=2.0.0.0
...在* .resx文件。我在項目目錄中找到了所有* .resx文件。瓦拉,在構建期間不再有空引用異常。但是,現在該項目無法構建,構建窗口沒有提供任何幫助解決的方法。這是字面上那裏的東西:
2>CoreCompile:
2> C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:TRACE /reference:C:\Users\afalanga\Dev\Tools\Program\FrontEnd\Resources\WrapNativeLibrary.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Management.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\x86\Release\FrontEnd.exe /resource:obj\x86\Release\FrontEnd.Panel.resources /resource:obj\x86\Release\FrontEnd.PrivilegesForm.resources /resource:obj\x86\Release\FrontEnd.Main.resources /resource:obj\x86\Release\FrontEnd.Properties.Resources.resources /resource:obj\x86\Release\FrontEnd.SoftwareLicense.resources /resource:Resources\WrapNativeLibrary.dll,WindowsUpdateTool.Resources.WrapNativeLibrary.dll /resource:Resources\INativeLibrary.dll,FrontEnd.Resources.INativeLibrary.dll /target:exe /win32icon:Resources\FrontEnd.ico /win32manifest:Resources\app.manifest Environment.cs Check.cs Exceptions.cs Updater.cs LibAccess.cs PrivilegesForm.cs Form1.Designer.cs OSInfo.cs Constants.cs PersonalizationManager.cs Silent.cs drivePanel.cs drivePanel.Designer.cs Main.cs Main.Designer.cs Program.cs Properties\AssemblyInfo.cs SoftwareLicense.cs SoftwareLicense.designer.cs VerticalProgressBar.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs
2>
2>Build FAILED.
它是由於這樣的事實,所引用的C#編譯器4.0版本?在這一點上,我完全無法檢查什麼。我正在考慮從TFS的這個代碼的分支新的結帳,並嘗試在那裏,但還沒有走了那條路線。我很感激任何洞察力,因爲我可以從項目屬性中看到的任何內容都表明它應該瞄準.NET 2.0並且它「應該」構建。
感謝, 安迪
請嘗試在這篇文章中的答案http://stackoverflow.com/questions/1251351/weird-visual-studio-2008-behaviour-build-failed-no-error-message – keyboardP
通過閱讀建議的線程中的意見,我對Visual Studio和.NET印象不及。對我來說,這種產品中存在如此岌岌可危的情況是毫無意義的:在製作.NET項目時存在這樣的微妙之處。 OP承認,將代碼從一個目錄移動到另一個然後再返回是沒有邏輯的。唯一的邏輯似乎是這個過程使VS正確地將項目「鏈接」到適當的.NET目標。有趣,但很奇怪。 –