views:

1432

answers:

2

I am working in Visual Studio 2008 on an ASP.Net application, which has been deployed to a test server. I would like to make a build without debug information to place in production, but the configuration manger only shows "Debug" in the configuration dropdown for my project.

My other VS projects show "Debug", "Release", "New...", and "Edit...".

Why do I not see a Release option, or the new and edit commands?

+1  A: 

The Configuration Manager for the Solution allows you to delete either (or both) of these default build configurations (through the Edit... option you mention above). I would bet that someone deleted the Release configuration.

You can get it back by recreating it, or copy the appropriate lines from a solution you make from scratch real quick. A file diff shows the following:

Default solution file:

GlobalSection(SolutionConfigurationPlatforms) = preSolution
    Debug|Any CPU = Debug|Any CPU
    Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU
    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Release|Any CPU.ActiveCfg = Release|Any CPU
    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection

Solution after I manually deleted the Release configuration:

GlobalSection(SolutionConfigurationPlatforms) = preSolution
    Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    {EDD50911-B94E-49A4-A08B-A2E91228A04B}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
sliderhouserules
Thanks for the suggestion.My solution file still has the two lines for release, so this is not the issue.
Maitus
+3  A: 

ASP.net web sites do not use the configuration manager to determine if debug info is included in the compile. You must set it in the web.config file. Visual Studio will never change debug to "false" for you automactially, as far as I know.

Find this section in your web.config file and change it to "false":

<!--
    Set compilation debug="true" to insert debugging
    symbols into the compiled page. Because this
    affects performance, set this value to true only
    during development.
-->

<compilation debug="true">

Visual Studio will ask you if you want it changed from false to true if you are running your web site in the IDE, but unfortunately it does not do the reverse for publishing (which seems more important to me).

If you have multiple projects in your solution, and at least one of them supports a Release configuration (such as a DLL) - it will appear in the configuration drop-down list. Building with Release selected still does not affect the website, however.

Keith Walton