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

查看:72
本文介绍了.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定义的预定义项目配置的名称。

要查看不同之处,请查看Build选项卡。 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常量

  • 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中引用)。但是我不知道有关启用了哪些优化的任何全面文档-实际上,我怀疑Microsoft希望自由地增强其优化器,而无需另行通知

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天全站免登陆