在发布模式下调试.NET [英] Debugging in .NET in Release mode

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

问题描述

前段时间,我已经阅读了一篇关于CLR的文章,其中作者表明,如果一个项目是以DEBUG模式编译的,每个操作符都来自一个NOP命令,从而允许调试一个代码。然而,今天我发现我们也可以在发布模式下调试...
请帮助了解差异。

解决方案

您可以在释放模式下进行调试。调试和发布只是构建配置(可以创建许多),真正的区别是Debug配置不会优化生成的二进制代码(优化的代码使调试变得复杂)。它还生成额外的调试数据,释放不会。


Some time ago I've read an article on CLR, where author showed that if a project is compiled in DEBUG mode, before each operator comes a NOP command, thus allowing to debug a code. Nevertheless, today I discovered that we can also debug in release mode as well... Please help to understand the difference.

解决方案

You can debug in Release mode to an extent. Debug and Release are simply build configurations (of which you can create many), the real difference is that Debug configuration doesn't optimize the generated binary code (optimized code complicates debugging). It also generates additional debug data which release does not.

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

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