配置管理器仅显示调试

发布于 2024-07-07 14:14:25 字数 208 浏览 9 评论 0原文

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

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

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

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

浊酒尽余欢 2024-07-14 14:14:25

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

如果您在 IDE 中运行网站,Visual Studio 会询问您是否希望将其从 false 更改为 true,但是不幸的是,它并没有对出版起到相反的作用(这对我来说似乎更重要)。

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

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.

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.

谈下烟灰 2024-07-14 14:14:25

在审查了最佳答案并与这个问题搏斗了几个小时之后,我遇到了这个答案。 我的解决方案是添加一个完整的应用程序:通常使用一个空的网站,但有同样的问题,版本不显示。 我向解决方案添加了一个完整的应用程序,然后它允许我在解决方案中部署我的项目,因为添加完整的应用程序还在下拉列表中添加了“发布”选项。 我非常感谢这个建议,但不知道为什么这个工具如此古怪。 再次感谢您的建议。

After reviewing the best answer and wrestling with this problem for a couple of hours, I ran across this answer. My solution was to add a full application: usually use an empty web site, but had the same problem of the release not displaying. I added a full application to the solution and it then allowed me to deploy my project within the solution, since adding the complete application also added the option of 'release' in the dropdown. I very much appreciate the advice, but not sure why this tool is so quirky. Thanks again for your suggestion.

入画浅相思 2024-07-14 14:14:25

解决方案的配置管理器允许您删除其中一个(或两个)默认构建配置(通过上面提到的“编辑...”选项)。 我敢打赌有人删除了发布配置。

您可以通过重新创建它来恢复它,或者从您从头开始快速创建的解决方案中复制适当的行。 文件差异显示以下内容:

默认解决方案文件:

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

我手动删除发布配置后的解决方案:

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

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
平定天下 2024-07-14 14:14:25

流程已更改,您只需在发布流程的设置部分选中底部的 2 个复选框,如图所示。 在 bin 文件夹中,您将找到 dll。

image

希望对

eiran有帮助

the process was changed, you just need to check the 2 bottom check boxes during the settings part of the publish process, as shown in the image. in the bin folder you'll find the dlls.

image

hope that helps

eiran

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文