简体   繁体   中英

Visual studio 2013 Slow in editing razor files

I just had installed VS2013. When I press Up or Down keys in a razor file editor which it is not pure html and has some razor codes VS 2013 slow down and permanently consume ~25% of CPU and everything is slow until I restart the VS.

I noticed that the problem only occurs when the razor document is reopened. If the document is already open when you open the Solution the problem doesn't occur.

I try many things but none of them fix the problem:

  • Disabling Resharper
  • Disabling Productivity Power Tools 2013
  • Deselecting " Rich client visual experience " in the " Options - Environment "
  • Disabling git plug-in or other Source Control: set Current source control plug-in to None

I test it in same machine in VS 2012 and everything was working normal.


Edit: I had tested different scenarios and finally I found out that the following lines cause the problem:

 <ul> <li style="@(!User.IsInRole("men") ? "display: none" : "")">Menu1</li> <li style="@(!User.IsInRole("women") ? "display: none" : "")">Menu2</li> </ul> 

If I remove the style="@(!User.IsInRole("men") ? "display: none" : "")" the problem not occurs anymore. Any idea?


Edit: I had reported the problem to microsoft here please upvote for better & quick support.

在发送给MS的票证中可以看到,这是一个错误,已在VS2013的Update 2 RTM中解决。

尝试在您的系统上禁用防病毒功能,VS2012项目上也遇到了类似的问题,该问题通过禁用防病毒功能(安全团队后来进行了配置更改)得以解决,有趣的是,我也仅遇到了Razor文件问题(McAfee是我的罪魁祸首)案件)。

If using TFS I have found that switching over to a server workspace is significantly faster if you have persitent internet connectivity. Otherwise, I would do two things, check the event log for any warnings or errors, and also use the task manager or process explorer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM