Long delays when formatting a .cshtml file in Visual Studio 2012

Working with MVC4 using Visual Studio 2012 at the moment, and when I format each CSHTML document (CTRL + E + D), I get the message "Waiting for background operation to complete the dialog"

This dialog is stored for about a minute, but before I had a wait time of up to 10 minutes.

My document does not consist long of 20 <lines of basic html.

I use only 1 add-in; Visual git.

EDIT: Removing an add-in is not affected.

EDIT2: now I get the following error trying to edit a file after formatting attempt.

Attempted TextBuffer edit operation while another edit is in progress. 
+4
source share
2 answers

For me, this seemed to be related to razor syntax since I only had it in one particular file.

For example, if I put the following code on one line, I had the described problem.

 @section BodyClassName {note} 

But when setting the closing parenthesis on the next line, the problem disappeared.

 @section BodyClassName {note } 

Yours faithfully

Stein

+1
source

I had the same problem, I did the following and it worked for me.

  • Cancel the ReadOnly attribute of your view (using Windows Explorer)
  • If you already have your view in VS open, close it and reopen it.
  • If you can click the Refresh button at the top of Solution Explorer, this will also reload the files.

It must be editable.

I hope this helps.

Thanks.

0
source

Source: https://habr.com/ru/post/1445807/


All Articles