Managing project configurations in VS 2010

Toby picture Toby · Jun 11, 2010 · Viewed 18.6k times · Source

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?

Answer

Greg D picture Greg D · Jun 11, 2010

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.