我有3个配置的项目:
- 项目A: Debug|AnyCPU, Release|AnyCPU
- 项目B: Debug|AnyCPU, Release|AnyCPU
- 项目C: Debug|x86, Debug|x64, Release|x86, Release|x64
项目C依赖于B,B依赖于A。(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 : 项目 'A.csproj' 没有设置 OutputPath 属性。请确保为该项目指定了一个有效的 Configuration 和 Platform 组合。Configuration='Debug' Platform='x86'。您可能会看到此消息,因为您正在尝试构建一个没有解决方案文件的项目,并且指定了不存在于该项目中的非默认 Configuration 或 Platform。[A.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(609,5): error : 项目 'B.csproj' 没有设置 OutputPath 属性。请确保为该项目指定了一个有效的 Configuration 和 Platform 组合。Configuration='Debug' Platform='x86'。您可能会看到此消息,因为您正在尝试构建一个没有解决方案文件的项目,并且指定了不存在于该项目中的非默认 Configuration 或 Platform。[B.csproj]