在ASP.NET中进行调试与发布 [英] debug vs release in asp.net

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

问题描述



调试和发布之间有什么区别?

当我们使用web.config-调试和web.config-发布时?

在运行时发生错误时,如何不使用-
重定向到示例页面 a)response.redirect()
b)web.config文件中的自定义错误


我已经在Google中搜索过,但找不到正确答案.

请让我回答.
在此先感谢.

Hi,

What is the difference between debug and release?

When we use web.config - debug and web.config - release?

How can we redirect to an sample page when error occurs at runtime without using -
a)response.redirect() or
b)custom errors in web.config file


I have searched in Google, I couldn''t get correct answer.

Please let me the answer.
Thanks in advance.

推荐答案

这些之间的最大区别是:
在调试版本中,将发出完整的符号调试信息,以在调试应用程序时提供帮助,并且不考虑代码优化.
在发行版中,不发出符号调试信息,并且优化了代码执行.
另外,由于在发布版本中未发出符号信息,因此最终可执行文件的大小小于调试可执行文件.

由于编译器的优化,内存布局或初始化的差异,人们可能会在发行版本中看到有趣的错误.这些通常称为Release-Only bugs :)

就执行速度而言,发布的可执行文件肯定会执行得更快,但并非总是如此.

它是从以下链接中提取的:
http://haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx [
The biggest difference between these is that:
In a debug build the complete symbolic debug information is emitted to help while debugging applications and also the code optimization is not taken into account.
While in release build the symbolic debug info is not emitted and the code execution is optimized.
Also, because the symbolic info is not emitted in a release build, the size of the final executable is lesser than a debug executable.

One can expect to see funny errors in release builds due to compiler optimizations or differences in memory layout or initialization. These are ususally referred to as Release - Only bugs :)

In terms of execution speed, a release executable will execute faster for sure, but not always will this different be significant.

It is Extracted from the below link:
http://haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx[^]


Custom Errors Section:

<configuration>
  <system.web>
    <customErrors defaultRedirect="GenericError.htm"

                  mode="RemoteOnly">
      <error statusCode="500"

             redirect="InternalError.htm"/>
    </customErrors>
  </system.web>
</configuration>


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

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