我已經制作了一個MSBuild項目,它只是以我們的解決方案文件作爲參數執行msbuild任務。我已經定義了一個BeforeBuild目標,我設置了一些屬性以及一個執行msbuild任務的Build目標。只有在調用CCNET中的MSBuild時纔會出現「輸出路徑屬性未設置」錯誤
我已確認在命令行控制檯中構建msbuild腳本時沒有發生錯誤。然而,當我在CCNET項目中使用它的MSBuild任務,我不斷收到以下錯誤:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (483,9): error: The OutputPath property is not set for project 'MyProject.msbuild'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
我檢查了構建日誌,似乎_CheckForInvalidConfigurationAndPlatform過程中發生的錯誤。它甚至無法繼續執行我的構建任務!由於腳本只建意在調試/發佈和AnyCPU爲平臺的解決方案,我想下面的行添加到我的MSBuild項目:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>.\bin\Debug\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>.\bin\Release\</OutputPath>
</PropertyGroup>
我仍然可以生成項目沒有錯誤的命令行,但CCNET正在返回上述相同的錯誤。
我不明白爲什麼CCNET不斷收到錯誤,我不知道還有什麼可以嘗試的。
請幫忙。
這是否對您有幫助? http://blogs.msdn.com/b/brandonwerner/archive/2010/03/14/the-nasty-visual-studio-platform-mcd-error-in-visual-studio-2010-rc.aspx – 2010-11-08 18:39:40
你能發佈在CC.NET中使用的msbuild任務? – alexandrul 2010-12-15 10:27:16