Visual studio - can't remove project configurations

C#Visual Studio-2010ConfigurationBuild

C# Problem Overview


I have a major problem with project configurations. Everything started when I wanted to add new solution configuration (named "Dev_WithSource") based on existing "Debug" configuration and checked "Create project configurations". For some reason project configurations were registered inside sln file, properly showing in Configuration manager, but "PropertyGroup Condition" blocks in csproj files weren't created. That resulted in "OutputPath not set ..." error.

So, I tried to repeat whole procedure. After deleting all lines mentioning "Dev_WithSource" from sln file, "Dev_WithSource" project configurations are still showing in configuration manager. I searched all csproj and sln file in my solution. Neither of them contain text "Dev_WithSource".

After all that I event tried developing add-in. I can fetch phantom configurations with project.ConfigurationManager.ConfigurationRowNames but I also can't delete them. Am I missing something? Are those configurations stored in some other files and not csproj/sln?

Thanks.

C# Solutions


Solution 1 - C#

  1. Access the configuration manager in one of two ways:

  2. From the menus on top: Build > Configuration Manager...

  3. From the drop down listing your configurations on the main tool bar select Configuration Manager...

  4. In the configuration manager dialog under Active solution configuration: choose <Edit...> from the drop down.

Configuration Manager

  1. A dialog opens showing all the configurations for your solution. Here you can select and click the Remove button.

Edit Solution Configurations

Solution 2 - C#

  1. Right-click->Unload your project with the configurations you want to remove.
  2. Right-click->Edit project file xml directly.
  3. Delete the Property groups containing conditions containing the name of the platforms/configurations you wish gone.
  4. Save and load project again. Unwanted configurations should be gone.
  5. If a configuration seems set up right but OutPutPath is still "not set", try moving its propertygroup tag up in the xml.

Solution 3 - C#

Let's suppose you want to remove "Release" configuration from the entire solution and the projects. So, first you go to Tools -> Nuget Package Manager -> Package Manager Console. From that console use the following command to remove the build from all the projects in the solution :

Get-Project -All | Foreach { $_.ConfigurationMAnager.DeleteConfigurationRow("Release") }

Then you remove it solution-wise as explained by Mike Grimm.

Solution 4 - C#

I know this is an old thread, but this was the answer for me:

In the Configuration Manager, select "Edit..." in the "Configuration" column for each project (not via the dropdown named Active solution configuration) that has configurations you want to remove.

In the dialog that pops up, mark each unwanted configuration and select "Remove".

Copied from https://stackoverflow.com/questions/491957/how-do-i-remove-a-project-configuration-in-visual-studio-2008

Solution 5 - C#

You need to remove the configuration from the solution AND the project. From the Configuration Manager:

  1. Active solution configuration > Edit > Remove
  2. Project contexts > Configuration > Edit > Remove

Solution 6 - C#

I solved this with utility which parses csproj files and inserts necessary propertygroup blocks into csproj files. Old project configurations still appear in configuration manager but I gave up trying to delete them.

Solution 7 - C#

In my case the issue was that the solution file was not in the same folder as project file so I had to copy the nuget folder into the solution folder to resolve this issue.

Solution 8 - C#

In Visual Studio for MAC -

  1. Double click your Solution > Configurations > General.
  2. Click on your 'ConfigToRemove' in the list then Remove (Ensure you tick delete also Configurations in Solution items), then Yes.
  3. Click OK to save your changes.
  4. Now, right Click on Solution and Tools > Edit File.
  5. Go to "GlobalSection(SolutionConfigurationPlatforms) = preSolution" and remove all the Configurations you no longer need otherwise they will still show up in Configuration Mappings even though there are no mappings in the project!
  6. Save and your done.

Solution 9 - C#

I know I am bit Late but here is complete solution. To remove configuration completely from solution and project property then open .sln file in any IDE as Plain text and delete all information regarding the configuration. NOTE- don't delete GUID values and debug/release configurations Then open .vcxproj file in XML format and delete all information regarding the configuration. This includes fundamental property for it, Platform Toolset and Assosiated property elements in XML language. NOTE- make sure to delete end tags. when you go back to visual studio, click replace all and you are good to go.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFilipView Question on Stackoverflow
Solution 1 - C#Mike GrimmView Answer on Stackoverflow
Solution 2 - C#Martin Clemens BlochView Answer on Stackoverflow
Solution 3 - C#AlirezaView Answer on Stackoverflow
Solution 4 - C#jay-dangerView Answer on Stackoverflow
Solution 5 - C#Christian CheneyView Answer on Stackoverflow
Solution 6 - C#FilipView Answer on Stackoverflow
Solution 7 - C#Sofia KhwajaView Answer on Stackoverflow
Solution 8 - C#WickedWView Answer on Stackoverflow
Solution 9 - C#user14176554View Answer on Stackoverflow