How to fix “The OutputPath property is not set for project…” error in Microsoft Visual Studio

When you build your Visual Studio solution you get the following error message:

The OutputPath property is not set for project ‘XYZ.csproj’. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration=’Debug’ Platform=’AnyCPU’. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.

Cause:

When you add a new project to a Visual Studio solution the IDE many times changes the settings in the Configuration Manager. Visual Studio 2010 adds a new solution platform “x86” and sets the platform of the existing projects to “x86”. It can also remove the projects from the build list and change their build configuration.

VS Configuration Manager Changed Values

Solution:

  • Open the Configuration Manager,
  • For all Active solution configurations:
    • Set the Active solution platform to “Any CPU”.
  • For all projects that  have to be included in the build:
    • Set the Configuration to “Debug” or “Release” depending on the environment,
    • Set the Platform to “Any CPU”,
    • Check the “Build” check box.

Leave a Reply