The OutputPath property is not set for this project

I had exact same error after adding a new configuration via ConfigurationManager in Visual Studio.

It turned out when the 'Production' configuration was added for the whole solution (and each project) the OutputPath element was not added to the .csproj files.

To fix, I went to the Build tab in project properties, changed OutputPath from \bin\Production\ to \bin\Production (deleted trailing \) and saved changes. This forced creation of the OutputPath element in the .csproj file and the project has built successfully.

Sounds like a glitch to me.


You can see this error in VS 2008 if you have a project in your solution that references an assembly that cannot be found. This could happen if the assembly comes from another project that is not part of your solution but should be. In this case simply adding the correct project to the solution will solve it.

Check the References section of each project in your solution. If any of them has a reference with an red x next to it, then it you have found your problem. That assembly reference cannot be found by the solution.

The error message is a bit confusing but I've seen this many times.


If you are using WiX look at this (there is a bug) http://www.cnblogs.com/xixifusigao/archive/2012/03/20/2407651.html

Sometimes new build configurations get added to the .wixproj file further down the file, that is, separated from their sibling config definitions by other unrelated XML elements.

Simply edit the .wixproj file so that all the <PropertyGroup> sections that define your build configs are adjacent to one another. (To edit the .wixproj in VS2013 right click on project in Solution Explorer, Unload project, right-click again->Edit YourProject.wixproj. Reload after editing the file.)


This happened to me because I had moved the following line close to the beginning of the .csproj file:

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>

It needs to be placed after the PropertyGroups that define your Configuration|Platform.