是否有优化code在C#中的风险?风险、code

由网友(花落,淚無聲)分享简介:在Visual Studio 2010专业版的构建设置面板中,有一个与标签优化code当然是......,我想看看一个CheckBox ......但作为异常谨慎,我问我的兄弟约它,他说,这是选中的调试和在C ++中它可能做的事情,将打破或错误的code ......但他不知道关于C#。In the build se...

在Visual Studio 2010专业版的构建设置面板中,有一个与标签优化code当然是......,我想看看一个CheckBox ......但作为异常谨慎,我问我的兄弟约它,他说,这是选中的调试和在C ++中它可能做的事情,将打破或错误的code ......但他不知道关于C#。

In the build settings panel of VS2010 Pro, there is a CheckBox with the label "optimize code"... of course, I want to check it... but being unusually cautious, I asked my brother about it and he said that it is unchecked for debugging and that in C++ it can potentially do things that would break or bug the code... but he doesn't know about C#.

所以我的问题是,我可以检查这个盒子我的发布版本,而不必担心它打破我的code?第二,如果能突破code,什么时候,为什么?链接解释的欢迎。

So my question is, can I check this box for my release build without worrying about it breaking my code? Second, if it can break code, when and why? Links to explanations welcome.

推荐答案

您通常会使用一个发布版本此选项。它的安全和主流的这样做。我们没有理由害怕释放code启用了优化。启用优化可以调试这是一个很好的理由来禁用它建立调试干扰。

You would normally use this option in a release build. It's safe and mainstream to do so. There's no reason to be afraid of releasing code with optimizations enabled. Enabling optimization can interfere with debugging which is a good reason to disable it for debug builds.

阅读全文

相关推荐

最新文章