0
所以我得到的錯誤:
The imported project "C:\Microsoft.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
當我運行此命令:
%WINDIR%\Microsoft.NET\Framework\v2.0.50727\msbuild.exe MyProject.csproj /target:publish
我發現別人指出我應該改變我的項目文件中的以下內容:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
對此:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
我已經試過這個,我仍然得到相同的錯誤。看起來好像兩個保留屬性都是空的或設置爲「C:」有沒有人有任何建議?
你能解釋一下怎麼說msbuild文件有助於診斷問題? – 2012-01-30 21:42:59
@Frank,它將基本打印出項目構建時這些屬性的內容。根據返回的值,OP應該能夠調試用於解析那些所需文件的路徑。 – Adam 2013-01-14 10:39:15