Configuration Manager仅显示Debug

Mai*_*tus 17 configuration build-environment visual-studio-2008 visual-studio

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

我的其他Visual Studio项目显示"Debug","Release","New ..."和"Edit ...".

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

Kei*_*ton 24

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

在您的web.config文件中找到此部分并将其更改为"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">
Run Code Online (Sandbox Code Playgroud)

如果您在IDE中运行您的网站,Visual Studio将询问您是否要将其从false更改为true,但遗憾的是它不会反向发布(这对我来说似乎更重要).

如果解决方案中有多个项目,并且其中至少有一个项目支持发布配置(例如DLL),它将显示在配置下拉列表中.但是,选择发布版本仍然不会影响网站.

  • @slartidan 如果您设置 debug="false",这就是您需要做的。下拉是无关紧要的。 (2认同)