我正在尝试在 .Net v4.0 上进行发布和调试构建,其中我有一个 MSBuild 项目文件而不是解决方案文件。我想使用相同的构建项目文件,但只是覆盖在“调试”和“发布”之间切换的配置属性。
当我执行如下
c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe buildinv.proj /target:rebuild "/property:Configuration=Debug" /verbosity:Diagnostic
我收到以下错误
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(483,9): error : The OutputPath property is not set for project 'buildinv.proj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform=''.
我可以看到错误发生在_CheckForInvalidConfigurationAndPlatform
.
如果我传递一个 OutputPath 属性,它将起作用
c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe buildinv.proj /target:rebuild "/property:Configuration=Debug" "/property:OutputPath=."
这是一个已知的错误 ?在我需要覆盖 Configuration 属性的地方,我将被迫覆盖 OutputPath 属性,即使我不希望这样做。
提前致谢。