views:

120

answers:

1

MSDN:

BaseOutputPath: Specifies the base path for the output file. If it is set, MSBuild will use OutputPath = $(BaseOutputPath)\$(Configuration)\

I tried to use the MSBuild Project Property BaseOutputPath instead of specifying OutputPath for every configuration & platform combination but Visual Studio complains when I compile:

The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination.

I put <BaseOutputPath>..\Binaries</BaseOutputPath> in the first unconditional <ProjectProperty>.

Am I using it incorrectly, or is this a known bug in Visual Studio?

+2  A: 

It is more likely a bug in the docs than in VS2008/MSBuild.

You can always reason out what you want to do with (greuling) inspection of e.g. your project file and the Microsoft.Common.Targets file it imports (typically through e.g. Microsoft.CSharp.targets; these files live at e.g.

c:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets

) and find all the MSBuild logic that eventually populates OutputPath.

In this case, I think the docs are lying outright, and you should e.g. explicitly say

<OutputPath>$(BaseOutputPath)\$(Configuration)</OutputPath>

in unconditional properties of your project file (and remove OutputPath from conditional properties) to make this work.

Brian
I see, but this then really negates the benefit of using BaseOutputPath in the first place. I could just use <OutputPath>..\Binaries\$(Configuration)</OutputPath>. Thanks for the clarification!
Hermann