.NET 中的调试与发布 [英] Debug vs. release in .NET

查看:27
本文介绍了.NET 中的调试与发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续我的上一个问题,是否有一个综合文档列出了所有可用的C# 应用程序中的调试和发布模式之间的区别,尤其是在 Web 应用程序中?

Continuing from my previous question, is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application?

有什么区别?

推荐答案

Debug"和Release"只是 Visual Studio 定义的预定义项目配置的名称.
要查看差异,请查看 Visual Studio 中项目属性中的构建选项卡.

"Debug" and "Release" are just names for predefined project configurations defined by Visual Studio.
To see the differences, look at the Build Tab in Project Properties in Visual Studio.

VS2005 的不同之处包括:

The differences in VS2005 include:

  • 调试配置中定义的调试常量

  • DEBUG constant defined in Debug configuration

在发布配置中启用优化代码

Optimize code enabled in Release configuration

以及通过单击高级"按钮可以看到的其他差异

as well as other differences you can see by clicking on the "Advanced" button

但你可以:

  • 在项目属性/构建中更改调试和发布配置的构建设置

  • Change the build settings for Debug and Release configurations in Project Propeties / Build

通过在解决方案资源管理器中右键单击解决方案并选择配置管理器来创建您自己的自定义配置

Create your own custom configurations by right-clicking on the solution in Solution Explorer and selecting Configuration Manager

我认为 DEBUG 常量的行为相当清楚(可以在 #if 预处理器指令或 ConditionalAttribute 中引用).但是我不知道关于启用了哪些优化的任何综合文档 - 事实上我怀疑微软希望在没有通知的情况下自由地增强他们的优化器

I think the behaviour of the DEBUG constant is fairly clear (can be referenced in the #if preprocessor directive or in the ConditionalAttribute). But I'm not aware of any comprehensive documentation on exactly what optimizations are enabled - in fact I suspect Microsoft would want to be free to enhance their optimizer without notice

这篇关于.NET 中的调试与发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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