.net - Visual Studio 2008 中的 BaseOutputPath 错误?

标签 .net visual-studio visual-studio-2008 msbuild

MSDN:

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/

相关文章:

c# - POCO;持久性无知和 DAL 依赖项 (NHibernate)

c - sal 注释(prefast)强制执行可变参数的数量

visual-studio - 在Visual Studio中增量搜索与快速查找

c++ - 静态库是否避免了名称重整问题?

c++ - wxThreadEvent 在哪里定义的?

c# - 在 .net 解决方案中的何处添加文件夹,以便在构建项目文件夹时创建?

c# - 为什么 C# 执行 Math.Sqrt() 比 VB.NET 慢?

c# - 与 Func<in T1, out TResult> 作为参数的协变/逆变

单元测试期间的 C# 扩展方法奇怪

git - Visual Studio git.exe的位置在哪里?