Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 528|回复: 0

解决VS2013+IE11调试DevExpress ASP.NET MVC的性能问题

[复制链接]
  • TA的每日心情
    奋斗
    2024-4-6 11:05
  • 签到天数: 748 天

    [LV.9]以坛为家II

    2034

    主题

    2092

    帖子

    70万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    705612
    发表于 2021-7-9 19:33:33 | 显示全部楼层 |阅读模式

    将一个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" />

    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-5-10 15:25 , Processed in 0.068132 second(s), 29 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表