views:

2430

answers:

4

I have a multi project solution in VS08. I just added a new Configuration called Release-VersionIncrement to the solution, specifying "use release" configuration as baseline. All project files were updated with that configuration. However, when I am trying to compile a specific project using this configuration, I get the following error:

Error 5 The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Release-VersionIncrement' Platform='AnyCPU' C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets 539 9 DataConversion

What's happening here? The project compiles fine in Release or Debug configuratin.

+3  A: 

Usually this happens when the OutputPath property of the project file is blank. Project files are just MSBuild files. To edit in Visual Studio: Right click on the proejct, pick "Unload project" then right click on the unloaded project and select "Edit ...".

Look for the Release-Versionincrement property group. It should look something like

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-VersionIncrement|AnyCPU' ">
  <OutputPath>bin\Release-VersionIncrement\</OutputPath>
  <DefineConstants>TRACE</DefineConstants>
  <Optimize>true</Optimize>
  <DebugType>pdbonly</DebugType>
  <PlatformTarget>AnyCPU</PlatformTarget>
  <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
  <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
  <ErrorReport>prompt</ErrorReport>
</PropertyGroup>

The important one there it the OutputPath, does it exist for your project file? If not add it and try again.

Sayed Ibrahim Hashimi
Sayed,Yes, I checked that, and the project file for the project that is having issues has the OutputPath property.
laconicdev
If the output path is correct and you're still receiving this error, you might have references to assemblies or other projects that don't exist any longer. Clean out the old references. That was my experience.
John K
I just stumbled onto this error, and had to modify the project file directly. Even though the project properties page said "Any CPU" the property was set to blank initially and I picked up a Platform=BPC setting from my environment variables. After I fixed that and set/reset the properties page from Any CPU to x86 and back, it still wouldn't build, claiming the platform was now 'x86' (?!?). Sure enough, I followed the steps here and found it was now set to x86, so I manually edited it and now everybody's happy again. Thanks guys!
DaveN59
A: 

The issue had to do with my project configuration. Here is the scenario:

Solution A references:

Project X references Project Y
Project Y Solution B (the one I am trying to buid): Project X Project Z

My solution was to create a configuration with the same name for Solution A, rebuild it, and then rebuild Solution B. This fixed the problem.

laconicdev
+2  A: 

Hi , I'd god the same problem when I used msbuild first.My solusion is : use the OutputPath property definitely.Like this: msbuild XXX.csproj /p:OutputPath=bin\Debug. Good luck. ken

HvH
A: 

I have also seen this error when our build agent was configured to run platform "Any CPU" (with spaces as displayed in Visual Studio) rather than "AnyCPU" (one word as specified in the project file).

Richard Dingwall