What is this 'Waiting for Background operation' in Visual Studio 2012?

Solution 1:

I was having the same problem, especially in cshtml pages. I found this page: https://devblogs.microsoft.com/aspnet/visual-studio-11-beta-razor-editor-issue-workaround that suggests changing the indent option in Tools > Options > Text Editor > HTML > Tab to Smart instead of Block. In my case it was already set to Smart and changing it back to Block fixed the problem.

Update: I was wrong, that didn't fix the dialogue, it just delayed it until I copied or pasted. What finally worked for me was to go to Tools > Import and Export Settings... > Reset all settings.

Possibly related question: Visual Studios 2010 - Asp.net MVC 4 Beta - long delays on paste and frequent crashing

Solution 2:

It is a very generic diagnostic. It is triggered by COM, heavily used in Visual Studio to implement extensibility. The underlying trigger is the IMessageFilter interface. The trigger occurs when COM marshals a method call to another thread and that call doesn't complete for 60 seconds.

There's little value in the actual notification, it is telling you something you already know. By the time 60 seconds have passed, you typically already have noticed things are not working well. Short from the wee bit of useful knowledge that Visual Studio isn't actually completely dead. The call however has to complete before VS gets usable again. There's little you can do but tap your foot and wait.

This problem is almost always caused by an add-in. Resharper is certainly a good candidate. You find the trouble-maker by disabling the add-ins one-by-one until the problem disappears. It is the kind of problem that's common with new versions of Visual Studio, it takes the add-in vendors a while to get the bugs and hangups ironed out. Contact the vendor for support and in general look for updates that may solve the issue.

Solution 3:

Deleting the Solutions "suo" file worked for me.

Solution 4:

I was having the same problem and in my case it was DevExpress.

It seemed to hang Visual Studio everytime I did a copy or cut operation, bringing up the message:

"Waiting for a background operation to finish".

Turns out it was actually doing a one off task in the background and it really was taking a while to do it (over 5 minutes).

Perhaps if I had waited normally, it could have gone away, but what finally fixed it was to bring up the Toolbox into view (was hidden/collapsed), which in turn brought up a window saying:

"adding [SomeDevExpressAssemblyNameHere].dll"

this kept updating itself with the name of every dll required by DevExpress to populate the toolbar.

This way I could see the operation progress and after it finished I could use copy/cut paste again as usual.

Hope this helps.

Solution 5:

For me the fix was to update the Web Essentials 2012 to version 1.8.

The problematic version was 1.6