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

Visual StudioVisual Studio-2012

Visual Studio Problem Overview


Occassionaly, but fairly often, for no apparent reason, VS 2012 will lock up with a dialogue that says, "Waiting for a background operation to finish". E.g. this may happen during a plain old code edit, not on explicitly invoking any IDE command.

What causes this, and is there anything I can do about this?

I am running ReSharper 7, and I am not the only one I know experiencing this.

Visual Studio Solutions


Solution 1 - Visual Studio

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: https://stackoverflow.com/questions/9435030/visual-studios-2010-asp-net-mvc-4-beta-long-delays-on-paste-and-frequent-cra/9449808#9449808

Solution 2 - Visual Studio

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 - Visual Studio

Deleting the Solutions "suo" file worked for me.

Solution 4 - Visual Studio

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 - Visual Studio

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

The problematic version was 1.6

Solution 6 - Visual Studio

Tools > Options > Text Editor > HTML > Tabs -> Identing -> None settings solved this problem for me.

Solution 7 - Visual Studio

This fixed it for me:

Tools > Options > Text Editor > HTML > Miscellaneous

Uncheck the option "Auto ID elements on paste in Source View"

I will post an update if the problem comes back.

Solution 8 - Visual Studio

I had this problem for a couple of days, tried uninstalling and reinstalling my visual studio 2012 ultimate edtion SP3... Still didn't work. So I deleted all my extensions (git tools for VS 2012 and Nuget Package downloader), restarted my VS and it worked liked a charm again! Hope it works !

Good luck!

Solution 9 - Visual Studio

http://geekswithblogs.net/sevenfortytwo/archive/2006/11/23/97947.aspx

RUN> iisreset 

Now it is working fine with VS 2012

Solution 10 - Visual Studio

I experienced this problem while running visual studio in a virtual machine - Virtual Box 4.2 running on Mac OS X Mountain Lion, hosting a fresh Windows 7 install with nothing else installed but Visual Studio. I found that the problem was caused by 2 separate issues.

Firstly, my project was on a folder shared from the host OS. In other words, on the Windows Guest, my project appeared on a network drive. So opening the project in Visual Studio from a network drive seemed to cause this problem because the problem went away when I copied the project onto the C drive of the Windows VM and opened it in Visual Studio from the copy on the C drive.

Secondly, I began to experience the problem again when the hard drive on the virtual machine was getting full. I had about 1GB free space available on the hard drive. When I increased the size of the hard drive on the virtual machine, this issue went away.

Solution 11 - Visual Studio

Just reproduced similar problem with Codemaid add-on. Found this conversation:

> There's a lot of details in this issue, but to try and recap the issue > is that the VS2012 C++ API introduced a deadlock issue when the API is > accessed from a UI thread (e.g. a WPF context like Spade). It wasn't > an issue in VS2010, and Microsoft has fixed it going forwards for > VS2013 but they will not be patching it for VS2012.

Seems to indicate that a fix (for Codemaid) should be coming:

> Please keep an eye on this thread for the ongoing resolution of the > issue. It ties in to that larger rewrite so I've been building towards > it by adding a lot of unit tests first to help ensure functionality > remains consistent after the changes.

Solution 12 - Visual Studio

For me it seemed to be related with the razor syntax, since I only had it on one particular file.

For example if I put the following code in one line I had the described issue.

> @section BodyClassName {note}

But when putting the closing parenthesis on the next line the issue went away

> @section BodyClassName {note
>}

Kind regards

Stijn

Solution 13 - Visual Studio

Far from an ideal solution, but please trying running visual studio in administrator mode i tried virtually everything, and this was the only thing that worked for me

Solution 14 - Visual Studio

Open Visual Studio, create a new MVC application, close the new application, open the old application and it works!

Solution 15 - Visual Studio

Check if IIS or another process (BizTalk maybe) is locking your DLLs/references
Kill/stop IIS or the other process if it is

Solution 16 - Visual Studio

i think i have found a clue! Every thing is ended to dcomcnfg.exe!

Open it and go under following path:

Component services>computers>my computer>dcom config

after click on dcom you'll see many warnings depend on amount of components on your pc.

Click yes on each message box in order to add correct record for dcom.

Solution 17 - Visual Studio

I found that VS also loads packages during the "background operation". You can remove unneeded extensions to make the operation faster.

Solution 18 - Visual Studio

I have it fixed weeks ago after I turn TeamViewer 8 Clipboard Sync off! now it appears back with no reason so I tried reset all settings and it worked for me.

Solution 19 - Visual Studio

I was having the same problem and running VS as an administrator seems to have done the trick for me (I had posted a similar question at https://stackoverflow.com/questions/15708373/visual-studio-2012-express-hangs-with-message-waiting-for-background-operation/16085085#16085085 that was marked as a duplicate for this one so I figured I would share here as well).

Solution 20 - Visual Studio

For me, it was Resharper addon opening a dialog which didn't show. I only found the dialog icon in the hidden icons menu on the task bar. When i got rid of the dialog, Visual Studio returned to normal immediately.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionProfKView Question on Stackoverflow
Solution 1 - Visual StudioWalterView Answer on Stackoverflow
Solution 2 - Visual StudioHans PassantView Answer on Stackoverflow
Solution 3 - Visual Studiochris.rickardView Answer on Stackoverflow
Solution 4 - Visual StudioRic TokyoView Answer on Stackoverflow
Solution 5 - Visual StudioRomanView Answer on Stackoverflow
Solution 6 - Visual StudioJitsView Answer on Stackoverflow
Solution 7 - Visual StudioTheTimView Answer on Stackoverflow
Solution 8 - Visual StudioLucas MCKENNAView Answer on Stackoverflow
Solution 9 - Visual StudioRamuView Answer on Stackoverflow
Solution 10 - Visual StudioMachabaView Answer on Stackoverflow
Solution 11 - Visual StudiodtmlandView Answer on Stackoverflow
Solution 12 - Visual StudioStijn LiesenborghsView Answer on Stackoverflow
Solution 13 - Visual StudioQuadeView Answer on Stackoverflow
Solution 14 - Visual StudioabiNerdView Answer on Stackoverflow
Solution 15 - Visual StudiohoussView Answer on Stackoverflow
Solution 16 - Visual StudioSenamasView Answer on Stackoverflow
Solution 17 - Visual StudioLiborView Answer on Stackoverflow
Solution 18 - Visual StudioAfshinView Answer on Stackoverflow
Solution 19 - Visual StudioChris SearlesView Answer on Stackoverflow
Solution 20 - Visual StudioJanBrusView Answer on Stackoverflow