不同平台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