BaseOutputPath: Specifies the base path for the output file. If it is set, MSBuild will use OutputPath = $(BaseOutputPath)\$(Configuration)\
我尝试使用 MSBuild 项目属性 BaseOutputPath,而不是为每个配置和平台组合指定 OutputPath,但 Visual Studio 在编译时提示:
The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination.
我输入<BaseOutputPath>..\Binaries</BaseOutputPath>
在第一个无条件<ProjectProperty>
.
我是否使用不当,或者这是 Visual Studio 中的一个已知错误?
最佳答案
这更有可能是文档中的错误,而不是 VS2008/MSBuild 中的错误。
您总是可以通过(严格的)检查来推理出您想要做什么,例如您的项目文件及其导入的 Microsoft.Common.Targets 文件(通常通过 Microsoft.CSharp.targets 等;这些文件位于例如
c:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets
)并找到最终填充 OutputPath 的所有 MSBuild 逻辑。
在这种情况下,我认为文档完全是在撒谎,你应该例如:明确地说
<OutputPath>$(BaseOutputPath)\$(Configuration)</OutputPath>
在项目文件的无条件属性中(并从条件属性中删除 OutputPath)以使其工作。
关于.net - Visual Studio 2008 中的 BaseOutputPath 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1424099/