Visual studio 2013 Slow in editing razor files

asp.net-mvc, asp.net-mvc-4, c#, razor, visual-studio-2013

Solution

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

Problem

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.

Original source