Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.
like image 246
Iman Mahmoudinasab Avatar asked Apr 26 '14 14:04

Iman Mahmoudinasab


1 Answers

As you can see in ticket sent to MS , It was a bug which solved in Update 2 RTM of VS2013.

like image 150
Iman Mahmoudinasab Avatar answered Oct 20 '22 04:10

Iman Mahmoudinasab