Asp.Net MVC 4编译调试 [英] Asp.Net MVC 4 compilation debug

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

问题描述

有什么区别:


  • <编译调试=真/> (默认VS 2013的web.config在调试模式下)

  • <编译调试=假/>

  • <编译/> (默认VS 2013的web.config在释放模式)

  • <compilation debug="true" /> (the default VS 2013 web.config in debug mode)
  • <compilation debug="false" />
  • <compilation /> (the default VS 2013 web.config in release mode)

的捆绑和缩小现在由 BundleTable.EnableOptimizations = TRUE始终打开; 所以我不知道为什么这个元素的使用和为什么值是不是在释放模式的默认设置。

The bundling and minification now is always turned on by BundleTable.EnableOptimizations = true; so I'm wondering why the usage of this element and why the false value is not the default in release mode.

推荐答案

没有列出所有它做的事情,让我们只说这确实很多。具有重要意义的,禁用调试上生成的脚本资源,您可能不希望缓存一些其他的东西浏览器缓存圈。
另外,如果出现异常,将不显示文件的名称,功能在源文件名和行号。
调试=假应该设置一旦你部署项目,以临时服务器或QA服务器,但它应该是调试=真正的你自己的机器上开发免得你碰上关于为什么你改变看不到要体现混乱问题在运行的网站等(高速缓存)或正是一个错误/异常在code发生了。
这里是进入更深的细节什么的调试链接=真正的作用:
调试web.config中= TRUE =坏事?

Without listing all the things it does, lets just say it does a lot. Of significance, disabling debug turns on browser caching of generated script resources and some other things you may not want cached. Also, if an exception occurs it won't display the file name, function name and line number of the file in your source. Debug=false SHOULD be set once you deploy your project to a staging server or QA server but it should be debug=true on your own machine for development lest you run into confusing problems about why changes that you make don't see to be reflected in the running web site etc (caching) or where exactly an error/exception happened in your code. Here is a link that goes into deeper details on what debug=true does: debug=true in web.config = BAD thing?

这篇关于Asp.Net MVC 4编译调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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