Release configuration not available in VS 2012

2019-08-11 03:45发布

问题:

I have a web application in 2012, which I suppose converted from 2010 solution. It has only one configuration "Debug" listed in toolbar, configuration manager and publish wizard. Is there any settings to be changed in the web.config or other places? I don't think its a setting at visual studio level because other new projects has both the Debug and Release settings

回答1:

The configurations that are available, are part of the solution file. When you open the *.sln file with a text editor, you will finde a section that looks like this:

GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection

In your case, I assume that the (in this example two) entries for Release are missing. In order to add a new configuration to your solution, you have use the Configuration Manager.

Menu -> Build -> Configuration Manager... under Active Solution Configurations you can add a new config for Release.