不同平臺Visual Studio項目我有3個項目,配置:大廈通過的MSBuild
- 項目A:調試| AnyCPU,發佈| AnyCPU
- 項目B:調試| AnyCPU,發佈| AnyCPU
- Project C:Debug | x86,Debug | x64,Release | x86,Release | x64
項目C在依賴項中有B,而在依賴項中有B。 (A < - B < - C)
我用* .bat文件,從命令行打造:
msbuild A.csproj /target:Build /property:Configuration=Debug;Platform=AnyCPU /verbosity:minimal
msbuild A.csproj /target:Build /property:Configuration=Release;Platform=AnyCPU /verbosity:minimal<br/>
msbuild B.csproj /target:Build /property:Configuration=Debug;Platform=AnyCPU /verbosity:minimal
msbuild B.csproj /target:Build /property:Configuration=Release;Platform=AnyCPU /verbosity:minimal
msbuild C.csproj /target:Build /property:Configuration=Debug;Platform=x86 /verbosity:minimal
msbuild C.csproj /target:Build /property:Configuration=Release;Platform=x86 /verbosity:minimal
msbuild C.csproj /target:Build /property:Configuration=Debug;Platform=x64 /verbosity:minimal
msbuild C.csproj /target:Build /property:Configuration=Release;Platform=x64 /verbosity:minimal
並且接受錯誤:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(609,5): error : The OutputPath property is not set for project 'A.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x86'. 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. [A.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(609,5): error : The OutputPath property is not set for project 'B.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='x86'. 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. [B.csproj]
.dll引用而不是ProjectReference是壞的,我想依賴關係也建立在每個構建。爲主項目定義'任何CPU'也是不好的,因爲它不是'任何CPU',它是x86或x64。對我而言,這個問題沒有得到很好的解決。我會評價者停止爲我的項目使用MSBuild,直到這樣做完成爲止。我想我也可以使用devenv.exe從命令行構建,但它接受這一點,不推薦使用,它是越野車,devenv有時會掛起直到無故死亡。 – watbywbarif