visual-studio 配置管理器只显示调试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/259311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Configuration Manager only shows Debug
提问by Maitus
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 2008 中使用 ASP.NET 应用程序,该应用程序已部署到测试服务器。我想在没有调试信息的情况下进行构建以投入生产,但配置管理器仅在我的项目的配置下拉列表中显示“调试”。
My other Visual Studio projects show "Debug", "Release", "New...", and "Edit...".
我的其他 Visual Studio 项目显示“调试”、“发布”、“新建...”和“编辑...”。
Why do I not see a release option, or the new and edit commands?
为什么我看不到发布选项或新的和编辑命令?
回答by Keith Walton
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.configfile. Visual Studio will never change debug to "false" for you automactially, as far as I know.
ASP.NET 网站不使用配置管理器来确定编译中是否包含调试信息。您必须在web.config文件中设置它。据我所知,Visual Studio 永远不会为您自动将调试更改为“false”。
Find this section in your web.configfile and change it to "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">
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).
如果您在 IDE 中运行您的网站,Visual Studio 会询问您是否希望将其从 false 更改为 true,但不幸的是,它不会反向发布(这对我来说似乎更重要)。
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.
如果您的解决方案中有多个项目,并且其中至少一个支持发布配置(例如 DLL) - 它会出现在配置下拉列表中。然而,选择发布的构建仍然不会影响网站。
回答by mike
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.
在查看了最佳答案并与这个问题搏斗了几个小时之后,我遇到了这个答案。我的解决方案是添加一个完整的应用程序:通常使用一个空的网站,但同样的问题是发布不显示。我向解决方案添加了一个完整的应用程序,然后它允许我在解决方案中部署我的项目,因为添加完整的应用程序还在下拉列表中添加了“发布”选项。我非常感谢您的建议,但不确定为什么这个工具如此古怪。再次感谢您的建议。
回答by 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.
过程已更改,您只需在发布过程的设置部分选中底部的 2 个复选框,如图所示。在 bin 文件夹中,您将找到 dll。


hope that helps
希望有帮助
eiran
永兰
回答by sliderhouserules
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:
手动删除Release配置后的解决方法:
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

