配置管理器只显示调试 [英] Configuration Manager only shows Debug

查看:21
本文介绍了配置管理器只显示调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2008 中使用 ASP.NET 应用程序,该应用程序已部署到测试服务器.我想在没有调试信息的情况下进行构建以投入生产,但配置管理器仅在我的项目的配置下拉列表中显示调试".

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 manager only shows "Debug" in the configuration dropdown for my project.

我的其他 Visual Studio 项目显示调试"、发布"、新建..."和编辑...".

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

为什么我看不到发布选项或新的和编辑命令?

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

推荐答案

ASP.NET 网站不使用配置管理器来确定编译中是否包含调试信息.您必须在 web.config 文件中设置它.据我所知,Visual Studio 永远不会为您自动将调试更改为false".

ASP.NET web sites do not use the configuration manager to determine if debug information 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.

在您的 web.config 文件中找到此部分并将其更改为false":

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">

如果您在 IDE 中运行您的网站,Visual Studio 会询问您是否希望将其从 false 更改为 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).

如果您的解决方案中有多个项目,并且其中至少一个支持发布配置(例如 DLL) - 它会出现在配置下拉列表中.然而,选择发布的构建仍然不会影响网站.

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.

这篇关于配置管理器只显示调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆