views:

376

answers:

2

I'm working on a solution with multiple projects (class libraries, interop, web application, etc) in VS2010.

For the web application, I would like to take advantage of the config transformations in VS2010, so at one point I added configurations for each of our environments: Development, Test, Production, and so on.

Some time later, after having rearranged the project layout, I noticed that some projects show all of the configurations in the properties page dropdown. Some projects (added since I did that setup) show only the standard Debug & Release configurations. Once I realized that this was going to make build configurations worse, not better, I decided to remove all of the extra configurations I had added.

I've removed all of the various configuration options from the solution, but the projects that had the alternate configuration options still have them, and I can't figure out how to get rid of them in individual projects.

Also, now that I see that not all projects have to have the same configurations, I would like to create my environmental configurations at the solution level, and in the web application project (for the config transforms), but leave all of the class libraries with the basic Debug/Release configurations. I've been unable to find any tool in the UI, or any information on the 'Net, concerning how to set up such a thing.

So, in short, what's the best/easiest way to manage configurations at the project level in VS2010?

+1  A: 

In the configuration manager screen, at the top, you'll see the solution configuration and solution platform. Each solution configuration is essentially a set of project configurations.

There is no "global everything" configuration because different technologies have different configuration options. How do you map a C# project's configuration to a C++ project, e.g.? This is why configurations are defined and maintained at the project level.

The right way to do it then is what you were doing. One of the administrative overheads of adding a new project to your solution is copying those project configurations in the new project and then configuring it appropriately in the solution configurations via the Configuration Manager screen.

To address your specific question, you can remove an existing project configuration from the Configuration Manager. On the project you want to modify, click the Configuration drop down, select Edit, and in the "Edit Project Configurations" dialog, select the configuration you want to remove and then click the "Remove" button.

Greg D
Thanks. I missed that page when I was searching for a solution. And while I was experimenting with the configuration manager I never tried to select <Edit> from the project configuration selectors, only the top one.
Toby
+2  A: 

You can do everything from the Configuration Manager dialog, accessed from Visual Studio's main menu via Build > Configuration Manager...

  • To remove configurations from your individual projects, select the project and open the drop down list in the "Configuration" column, then click .
  • To select the configurations to build for a new solution configuration, make the solution configuration active, then select the configuration to build for each project.

See also How to: Create and Edit Configurations

Jim Lamb
Thanks, Jim. Unfortunately, StackOverflow will only let me select one "answer."
Toby
No worries, Toby. I'm glad you got the guidance you needed. This is definitely not a very straightforward user experience in Visual Studio.
Jim Lamb