Build errors when you delete the DEBUG configuration from a solution

Symptoms
After you delete the DEBUG build configuration from your solution in Visual Studio, and then you unload one or more referenced projects, you may encounter a build error that resembles the following:
The OutputPath property is not set for project 'ClassLibrary1.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
This a known bug in Visual Studio 2012, 2013, and 2015. 

This issue occurs when the configuration is deleted. IN this situation, the Debug build configuration is left in the project file, as follows: 

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Resolution
To work around this issue, change the name of the configuration from "Debug" to the new configuration name that was created in the csproj file of the unloaded project, as follows:

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Change this to the following:
<Configuration Condition=" '$(Configuration)' == '' ">Dev</Configuration>
More information
Microsoft is researching this problem and will post new information in this article it becomes available.

Steps to reproduce the problem

  1. Create a new Visual Studio Solution (.sln).
  2. Create a C# class library project.
  3. Create a C# console application.
  4. Add a reference of the class library in the console application.
  5. Open Configuration Manager, and then create a new solution configuration that's named "Dev" (or you can give any name):
    • Copy settings from Debug.
    • Select the check box to create new project configurations.
  6. Delete the previous project configurations that are named "Debug" from both projects:
    • Delete the solution configuration that was named "Debug."
    • Make sure that the "Debug" output folders are deleted from both projects (from both the "obj" and "bin" directories of each).
  7. The configuration name "Dev" has now replaced "Debug" (both at the project and solution levels).
  8. Select the new solution configuration ("Dev" or whatever new name you used).
  9. Clean the solution.
  10. Add the class library as a reference to the console application, and make use of a class defined in it.
  11. Set the console application as startup.
  12. Build the solution and run it.
  13. Unload the class library project from Solution Explorer.
  14. Make a change to the console application code file (for example, to "Program.cs"), and then try to build it.
  15. You receive an error message that resembles the following:

    ***The OutputPath property is not set for project 'ClassLibrary1.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. ***
Build errors with removing Debug configuration
Properti

ID Artikel: 3175301 - Tinjauan Terakhir: 08/24/2016 22:03:00 - Revisi: 4.0

Visual Studio Ultimate 2015, Visual Studio Professional 2015, Visual Studio Premium 2015, Visual Studio Enterprise 2015, Microsoft Visual Studio Ultimate 2013, Microsoft Visual Studio Professional 2013, Microsoft Visual Studio Premium 2012, Microsoft Visual Studio Professional 2012

  • KB3175301
Tanggapan