将一个MVC项目从12.2升级到14.2,VS2012升到2013,发现使用IE11调试非常慢卡死,CPU占用100%,后来经过排除,发现只有DevExpress的MVC项目有这个问题。

最后在DevExpress的支持页面找到答案,原来是VS2013的Browser Link功能造成的。

  • If you use Visual Studio 2013 for web development, you could face some issues:
    1) A Web application is being loaded for a very long time/client scripts are being loaded long when you debug it on the development server;
    2) CPU usage by the local IIS worker process increases enormously while debugging the application;
    3) Pages that use the jQuery library return JavaScript errors;
    4) HTML markup contains garbage tags.
In Microsoft Visual Studio 2013, the Browser Link feature was introduced. It provides dynamic exchange between IDE and any open browser on your machine. With the help of this feature, you can test changes in page markup in browsers on the fly, inspect HTML objects, etc. However, the use of this feature might cause abovementioned problems in the debugging process. 
A common solution is to disable Browser Link in Visual Studio:

via menu (uncheck the "Enable Browser Link" check box)

解决办法是在主界面菜单中禁用这个功能,就在绿色运行尖头按钮旁边的Browser Link下拉菜单中。
 
或者修改web.config文件,添加下面的内容:

<appSettings><add key="vs:EnableBrowserLink" value="false"/></appSettings>

DevExpress支持参考地址 https://www.devexpress.com/Support/Center/Question/Details/T102322
 
此问题的详细分析:
 
Case 1 and 2: The cause of the problem is that the Browser Link feature requires dynamic compression to be disabled. The dynamicCompressionBeforeCache attribute allows IIS to dynamically compress the response when a request is made for the first time and queues the content for compression. When this attribute is enabled, a page loads faster, whereas if it is disabled, it causes additional CPU consumption and increases the page load time -  see the remarks section of the MSDN : urlCompression article.

In these cases, the only solution is to disable the Browser Link feature as described above.

Case 3:
Browser Link's Scripts Manager adds a jQuery reference to the <body> tag. JavaScript is an interpreter language and processes code line-by-line, so the place where the scripts are referenced or declared is really important. If a custom script that uses the jQuery library is declared before the body (commonly, scripts are added in the head), it will not work correctly.

If you want the Browser Link option to be enabled, you can move jQuery-dependable scripts to the <body> tag.

Case 4:
This issue is usually caused by a page compression conflict. If URL compression has the enabled dynamicCompressionBeforeCache that is set by default for IIS 7.5, it interferes with HttpModules that are used by Browser Link, and produces problems in output.
If you want the Browser Link option to be enabled, disable the dynamicCompressionBeforeCache (web.config -> system.webServer):

<urlCompression doDynamicCompression="true"doStaticCompression="true"dynamicCompressionBeforeCache="false" />

解决VS2013+IE11调试DevExpress ASP.NET MVC的性能问题的更多相关文章

  1. 使用MvcMiniProfiler调试ASP.NET MVC网站性能

    http://www.cnblogs.com/qiuliang/archive/2011/12/01/2270909.html 使用MiniProfiler给Asp.net MVC和Entity Fr ...

  2. ASP.NET(支持 ASP.NET MVC)性能优化包 - combres 介绍

    项目地址:https://github.com/buunguyen/combres Overview Combres (previously hosted in CodePlex) helps you ...

  3. 使用MiniProfiler调试ASP.NET MVC网站性能

    MiniProfiler 以前开发Webform的时候可以开启trace来跟踪页面事件,这对于诊断程序的性能是有很大的帮助的,起到事半功倍的作用,今天我就来谈用mvc开 发项目的调试和性能监控.EF框 ...

  4. 转:asp.net mvc ef 性能监控调试工具 MiniProfiler

    MiniProfiler官网:http://miniprofiler.com/ MiniProfiler的一个特别有用的功能是它与数据库框架的集成.除了.NET原生的 DbConnection类,Mi ...

  5. asp.net mvc ef 性能监控调试工具 MiniProfiler

    MiniProfiler是一款针对.NET, Ruby, Go and Node.js的性能分析的轻量级程序.可以对一个页面本身,及该页面通过直接引用.Ajax.Iframe形式访问的其它页面进行监控 ...

  6. 解决ASP.NET MVC(post数据)Json请求太大,无法反序列化(The JSON request was too large to be deserialized)

    这个问题出现的场景并不是很多,当你向服务端异步(ajax)post数据非常大的情况下(比如做权限管理的时候给某个角色分配权限那么就可能会出现,我所遇到的就是该角色大概200个模块每个模块平均2个功能- ...

  7. 自学MVC看这里——全网最全ASP.NET MVC 教程汇总

    MVC架构已深得人心,微软也不甘落后,推出了Asp.net MVC.小编特意整理博客园乃至整个网络最具价值的MVC技术原创文章,为想要学习ASP.NET MVC技术的学习者提供一个整合学习入口.本文从 ...

  8. 七天学会ASP.NET MVC (六)——线程问题、异常处理、自定义URL

    本节又带了一些常用的,却很难理解的问题,本节从文件上传功能的实现引出了线程使用,介绍了线程饥饿的解决方法,异常处理方法,了解RouteTable自定义路径 . 系列文章 七天学会ASP.NET MVC ...

  9. ASP.Net MVC开发基础学习笔记(3):Razor视图引擎、控制器与路由机制学习

    一.天降神器“剃须刀” — Razor视图引擎 1.1 千呼万唤始出来的MVC3.0 在MVC3.0版本的时候,微软终于引入了第二种模板引擎:Razor.在这之前,我们一直在使用WebForm时代沿留 ...

随机推荐

  1. apache+tomcat分布式集群搭建

    今天搭建apche+tomcat分布式集群,遇到很多问题,在网上找到的很多都不成功,然后和同事一起研究了一下,最终搭建成功了.做个笔记,以备自己以后参考. 1,下载apache.在下载Apache(2 ...

  2. ssh IP打通,hadoop启动失败

    ssh ip 无密码打通,hadoop启动失败 报错为:host'主机名' can't be established. 纠结了接近一个多小时 之后必须ssh 主机名 , yes一下,发现hadoop能 ...

  3. Egret 压缩与解压(jszip)

    一 jszip是什么 二 为什么要用jszip 三 如果使用zip 一 jszip是什么 jszip 是一个 JavaScript 库,可直接在浏览器上创建 zip 压缩档. 二 为什么要用jszip ...

  4. mysql高可用框架-MHA

    MHA高可用架构 用一个管理节点监控后端数据库主库可用性 提供VIP漂移接口,不提供具体方法 提供补全从库日志的脚本   MHA 监控主库,提供自动主从切换: 提供VIP漂移接口 提供补全从库日志的脚 ...

  5. highcharts 统计的样式

    highcharts 官网:http://www.hcharts.cn/

  6. TS 流的解码过程(系摘抄)

    TS 流解码过程: 1. 获取TS中的PAT 2. 获取TS中的PMT 3. 根据PMT可以知道当前网络中传输的视频(音频)类型(H264),相应的PID,PCR的PID等信息. 4. 设置demux ...

  7. 【Django】Django model与数据库操作对应关系(转)

    Django对数据库的操作分用到三个类:Manager.QuerySet.Model. Manager的主要功能定义表级方法(表级方法就是影响一条或多条记录的方法),我们可以以models.Manag ...

  8. 2.Mybatis入门程序(单表的增删改成)

    这里讲的单表的增删改查,是由mapper代理的增删改查,先来看看步骤: 1.jar包的导入 2.配置全局的配置文件 3.建立接口 4.编写mapper.xml 5.测试 工程结构:这个你们自己可以调整 ...

  9. hdu 3667 拆边加最小费用流

    Transportation Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  10. __new__

    [__new__] object.__new__(cls[, ...]) Called to create a new instance of class cls. 用于创建类对象cls的实例. __ ...