配置管理器仅显示调试
我正在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
ASP.NET 网站不使用配置管理器来确定编译中是否包含调试信息。 您必须在
web.config
文件中设置它。 据我所知,Visual Studio 永远不会自动将调试更改为“false”。在
web.config
文件中找到此部分并将其更改为“false”:如果您在 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":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.
在审查了最佳答案并与这个问题搏斗了几个小时之后,我遇到了这个答案。 我的解决方案是添加一个完整的应用程序:通常使用一个空的网站,但有同样的问题,版本不显示。 我向解决方案添加了一个完整的应用程序,然后它允许我在解决方案中部署我的项目,因为添加完整的应用程序还在下拉列表中添加了“发布”选项。 我非常感谢这个建议,但不知道为什么这个工具如此古怪。 再次感谢您的建议。
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.
解决方案的配置管理器允许您删除其中一个(或两个)默认构建配置(通过上面提到的“编辑...”选项)。 我敢打赌有人删除了发布配置。
您可以通过重新创建它来恢复它,或者从您从头开始快速创建的解决方案中复制适当的行。 文件差异显示以下内容:
默认解决方案文件:
我手动删除发布配置后的解决方案:
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:
Solution after I manually deleted the Release configuration:
流程已更改,您只需在发布流程的设置部分选中底部的 2 个复选框,如图所示。 在 bin 文件夹中,您将找到 dll。
希望对
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.
hope that helps
eiran