Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC3 Razor views - extremely slow editing in VS2010

Tags:

I've got a relatively small project written in ASP.NET MVC3. After working a while, Visual Studio 2010 becomes very slow in Razor views (other file types work fine). With "slow" I mean "every keystroke takes around 1 second to register". It doesn't matter what that keystroke was - typing a single letter is as slow as pasting a screenful of markup. During this slowdown VS2010 consumes 1 CPU core to 100%. After I restart VS2010, everything goes smoothly again for a small while. This happens in any and all Razor views.

My PC isn't the best, but it should be enough: Core 2 Duo 6700, 4GB of RAM (currently only 75% filled with VS2010 being slow and all, so it's not a RAM shortage), Windows 7 x64.

The project is close to an end, and I remember that for most time there were no problems. This has started only recently, although I cannot imagine what could have caused it.

Does anyone have any ideas about what could be wrong and what could be done to fix it?

like image 743
Vilx- Avatar asked Aug 31 '11 08:08

Vilx-


2 Answers

It is plugins - TFS/AnkvSVN and ReSharper have all caused problems for me.

Turn them off one by one, to discern which one (if only one) is causing you grief.

When you find the culprit, make sure you keep up on any patches with it.

In extreme cases, turn if off if you have a long development session and don't need it the whole time (SVN for instance could be turned on when you are ready to do commits and check ins, etc.)

like image 137
one.beat.consumer Avatar answered Sep 30 '22 08:09

one.beat.consumer


The issue is resolved for me, by installing the Mvc Html5 Templates.

After the installation, I picked XHTML5 and then back HTML5 from the "Target schema" combo box. After that, the paste was instant!

Edit: I uninstalled "Mvc Html5 Templates" and the issue didn't reappear. Perhaps it has something to do with the "HTML 5 Intellisense"

like image 24
Panos Theof Avatar answered Sep 30 '22 07:09

Panos Theof