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

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.

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

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.

Deleting the Solutions "suo" file worked for me.

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.

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

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

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.

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!

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.

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.

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

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

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

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

http://geekswithblogs.net/sevenfortytwo/archive/2006/11/23/97947.aspx
RUN> iisreset
Now it is working fine with VS 2012

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.

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

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.

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 Visual Studio 2012 Express Hangs with Message "Waiting for Background Operation to Complete" on Format Document Command that was marked as a duplicate for this one so I figured I would share here as well).

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.

Related

Disable JIT Debugger VS2010 WS2012 [duplicate]

Not to bore you, I'm gonna make long story short. Two machines, identical systems on them, identical programs (mostly). One has Visual Studio installed, one has ... uhmm, something else.
Sometimes when I try to install applications from let's say a CD, Visual Studio's Just-In-Time Debugger pops up, reports an "unhandled win32 exception in ..." and asks whether I want to debug using "New instance of Microsoft VIsual Studio 2010". If I choose Yes, it runs VS, if I choose No it closes the thing, and I'm back in Windows Explorer.
Which would be ok, except I know the application is perfectly all right, and this way I cannot install it (in this latest cast it was the client from my bank for internet banking and paying bills and such).
So, how do I get rid of that thing (just-in-time debugger)?
I don't want to uninstall VS since I'm using it daily, of course.
Edit 1 :: I tried disabling Just-In-Time debugging in VS's Tools/Options/Debugging/Just-In-Time, then unchecking all three checkmarks, but that just gave another error when trying to run the executable installation program.
An unhandled win32 exception occurred in autorun.exe [some number]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from ...
Check the documentation index for 'Just-in-time debugging, errors' for more information.
Very informative :/
Edit 2 :: The application runs fine on the other machine that doesn't have VS installed. To a large extent software on both machines is the same, with just some minor differences (systems installed from image). Minor differences: notepad2, ++, git, ... some small stuff that is left to dev's own choosing.
I don't want this to sound as rant against VS, since I realize it's taking that tone, but I extremelly dislike software that is not self contained and messes other software up. And I had the same problem before with other applications as well. So for now, I'm blaming VS.
If necessary, I'm willing to disable all kinds of debugging for this thing to work permanently (mostly use print statements anyways), if that will help. And if it possible.
I just had this problem today with Visual Studio 2013. This MSDN article:
Just-In-Time Debugging in Visual Studio works for me. In my case, I just rename Debugger to Debugger_del and DbgManagedDebugger to DbgManagedDebugger_del.
To disable Just-In-Time debugging by editing the registry
On the Start menu, search for and run regedit.exe
In the Registry Editor window, locate and delete the follow registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
If your computer is running a 64-bit operating system, also delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger
Take care not to accidentally delete or change any other registry keys.
Close the Registy Editor window.
I am adding this response even though this is an old topic because I have just spent most of the day on this very issue and finally solved it. Every solution I found focused on disabling or turning off JIT debugging in Visual Studio, deleting keys from the registry or changing IE script debugging settings. But if you don't have a registered copy of VS, you have a problem. Of course, many of the solutions work in different ways but then you are left with the error above "no installed debugger has just-in-time debugging enabled" which no-one seems to have an answer for. However, the answer is not to disable JIT but rather stop server side debugging in your application. Unless you actually want to do server side debugging it is not necessary for it to be on.
It makes complete sense to me now because I had server side debugging turned on in ASP. Before installing VS, it made no difference because no debugger was assigned to handle the bugs so they were sent to the browser. Once I installed VS, JIT took over and did what tit was supposed to do.
So the quick answer, open IIS, click on default sites or your sites and in your application settings, ASP in my case, turn off server side debugging!!
It may not be everyone's answer, or even the solution to the above problem, but hope it provides more insight to this problem and help someone else.
regarding the key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug and SOFTWARE\WOW6432Node\Microsoft, I could only change the Auto value from 1 to 0 and it worked.:
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Auto /d 0
REG ADD "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Auto /d 0
If you're running the same software on two machines and it's crashing on one(which is what's happening if the debugger is starting) then you probably have something else going wrong on your machine. It could be that you've got driver incompatibility issues, or that some of the other software you have installed on the machine has incompatible versions of dll's...
You need to try to eliminate as many of the differeces as you can (easier said than done, I know)... If you copy the contents of the CD onto a local disk, does that help? If you shutdown your virus checker while you install the software does that help? Does it help if you turn the network off? You've said that both machines have 'mostly' the same, software, what happens if you uninstall some of the differences? Have both machines been patched to the same level?
As Visual studio is trying to start up when you have issues, have a look at the call stack and see what dlls are loaded, print it out... run some of the other software that crashes on that machine and do the same thing... look for any common libraries and do a comparison between the machines to see if they have the same version of the libraries...
Of course it could also be that it's a hardware issue (I've had intermittent failures before now because one of my drives was getting ready to fail and others because my graphics chip was running too hot)...
As I said, not really an answer, but some things to consider...
If all else fails... you're probably stuck doing your bills on the other computer (although another experiment might be to create a VPC on the broken pc to see if it worked then)...
Right click on Project--Properties. Select the 'Web' tab. Under Debuggers, check 'Silverlight' (beside ASP.NET that is already checked).
Now visual studio won't debug your javascript because fortunately it can't debug Silverlight and javascript at the same time. You can now attach your javascript to the browser debugger.
This problem was appearing when I started pdf viewer. I reinstalled this program in other folder (another disc in comp) and in my case it worked.

Visual Studio 2012 Designer throws exception 0x80270257

TLDR; VS2012 throws an exception like below when trying to edit XAML in the Designer running VS2012 as a RemoteApp.
Right, I may be asking this in the wrong place, but I'm at my wits end with this.
Basically what I'm trying to achieve is to run VS2012 on my Surface RT for quick edits of Windows Store apps. The way to do this is to run it as a RemoteApp which actually works great considering you can just hit F5 to build and launch for debug directly on the Surface, the problem is that the VS Designer bombs and throws the exception below.
For initial lab tests I was running VDI as a Session mode setup - i.e. VS2012 was running on WS2012, this gave the exact same exception as described herein. But after discussing it with some people way more into VDI than me we came to the conclusion that it was because it was running on WS2012 and not Windows 8. So I went ahead and changed things around running VDI in virtualization mode.
Said and done I spent a day installing and tailoring a Windows 8 Pro image with VS2012, various SDKs and whatnot. When it came to sysprepping this I ran into a different issue in that sysprep would bomb out with a "fatal error", after another day of trawling through the web and speaking to support it was decided this was because the pre-installed Windows Store apps had been updated. So another day gone reinstalling everything, this time sysprep worked fine and I was able to commission the virtual desktop, however when it came to publishing Visual Studio (among others) as a RemoteApp again I ran into issues. After another day and a half googling, binging, tweeting and finally calling support it transpired this was because only Windows 8 Enterprise edition could be used for RemoteApp publishing ... thanks MS, you couldn't have made this clear in your "best practices"? Anyway, spending another day reinstalling windows and all apps, SDKs and documentation. This time I am finally able to both sysprep, commission and publish RemoteApps. Yey, I'm a happy camper seeing as I should finally be able to do what I set out to do - quick XAML edits and debugging directly on my Surface RT.
Not so.. as the exception is, some five hundred reinstalls later still rearing it's ugly head. The "gurus" I initially spoke to are as stumped as me and can only offer that "it should work" and "it worked fine for the person I configured it for".
So, any ideas greatly appreciated here. While I can use the text editor to edit the XAML and Bob's my uncle in terms of quickfixes and debugging sessions I would much prefer to have it working properly and to be able to use the visual designer (or Blend - as the same exception is thrown there) for certain changes.
This is the actual exception;
2
I had the same problem and I just found a solution.
I had the Windows 'explorer' shell deactivated because I am using BBlean (an alternate shell for Windows, based on BlackBox). Apparently this was blocking the app manager. Disabling BBlean and starting Windows normally fixed the error.
So if you happen to be using a replacement shell, try disabling it.

How to disable Visual Studio debugger?

Not to bore you, I'm gonna make long story short. Two machines, identical systems on them, identical programs (mostly). One has Visual Studio installed, one has ... uhmm, something else.
Sometimes when I try to install applications from let's say a CD, Visual Studio's Just-In-Time Debugger pops up, reports an "unhandled win32 exception in ..." and asks whether I want to debug using "New instance of Microsoft VIsual Studio 2010". If I choose Yes, it runs VS, if I choose No it closes the thing, and I'm back in Windows Explorer.
Which would be ok, except I know the application is perfectly all right, and this way I cannot install it (in this latest cast it was the client from my bank for internet banking and paying bills and such).
So, how do I get rid of that thing (just-in-time debugger)?
I don't want to uninstall VS since I'm using it daily, of course.
Edit 1 :: I tried disabling Just-In-Time debugging in VS's Tools/Options/Debugging/Just-In-Time, then unchecking all three checkmarks, but that just gave another error when trying to run the executable installation program.
An unhandled win32 exception occurred in autorun.exe [some number]. Just-In-Time debugging this exception failed with the following error: No installed debugger has Just-In-Time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from ...
Check the documentation index for 'Just-in-time debugging, errors' for more information.
Very informative :/
Edit 2 :: The application runs fine on the other machine that doesn't have VS installed. To a large extent software on both machines is the same, with just some minor differences (systems installed from image). Minor differences: notepad2, ++, git, ... some small stuff that is left to dev's own choosing.
I don't want this to sound as rant against VS, since I realize it's taking that tone, but I extremelly dislike software that is not self contained and messes other software up. And I had the same problem before with other applications as well. So for now, I'm blaming VS.
If necessary, I'm willing to disable all kinds of debugging for this thing to work permanently (mostly use print statements anyways), if that will help. And if it possible.
I just had this problem today with Visual Studio 2013. This MSDN article:
Just-In-Time Debugging in Visual Studio works for me. In my case, I just rename Debugger to Debugger_del and DbgManagedDebugger to DbgManagedDebugger_del.
To disable Just-In-Time debugging by editing the registry
On the Start menu, search for and run regedit.exe
In the Registry Editor window, locate and delete the follow registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
If your computer is running a 64-bit operating system, also delete the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger
Take care not to accidentally delete or change any other registry keys.
Close the Registy Editor window.
I am adding this response even though this is an old topic because I have just spent most of the day on this very issue and finally solved it. Every solution I found focused on disabling or turning off JIT debugging in Visual Studio, deleting keys from the registry or changing IE script debugging settings. But if you don't have a registered copy of VS, you have a problem. Of course, many of the solutions work in different ways but then you are left with the error above "no installed debugger has just-in-time debugging enabled" which no-one seems to have an answer for. However, the answer is not to disable JIT but rather stop server side debugging in your application. Unless you actually want to do server side debugging it is not necessary for it to be on.
It makes complete sense to me now because I had server side debugging turned on in ASP. Before installing VS, it made no difference because no debugger was assigned to handle the bugs so they were sent to the browser. Once I installed VS, JIT took over and did what tit was supposed to do.
So the quick answer, open IIS, click on default sites or your sites and in your application settings, ASP in my case, turn off server side debugging!!
It may not be everyone's answer, or even the solution to the above problem, but hope it provides more insight to this problem and help someone else.
regarding the key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug and SOFTWARE\WOW6432Node\Microsoft, I could only change the Auto value from 1 to 0 and it worked.:
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Auto /d 0
REG ADD "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug" /v Auto /d 0
If you're running the same software on two machines and it's crashing on one(which is what's happening if the debugger is starting) then you probably have something else going wrong on your machine. It could be that you've got driver incompatibility issues, or that some of the other software you have installed on the machine has incompatible versions of dll's...
You need to try to eliminate as many of the differeces as you can (easier said than done, I know)... If you copy the contents of the CD onto a local disk, does that help? If you shutdown your virus checker while you install the software does that help? Does it help if you turn the network off? You've said that both machines have 'mostly' the same, software, what happens if you uninstall some of the differences? Have both machines been patched to the same level?
As Visual studio is trying to start up when you have issues, have a look at the call stack and see what dlls are loaded, print it out... run some of the other software that crashes on that machine and do the same thing... look for any common libraries and do a comparison between the machines to see if they have the same version of the libraries...
Of course it could also be that it's a hardware issue (I've had intermittent failures before now because one of my drives was getting ready to fail and others because my graphics chip was running too hot)...
As I said, not really an answer, but some things to consider...
If all else fails... you're probably stuck doing your bills on the other computer (although another experiment might be to create a VPC on the broken pc to see if it worked then)...
Right click on Project--Properties. Select the 'Web' tab. Under Debuggers, check 'Silverlight' (beside ASP.NET that is already checked).
Now visual studio won't debug your javascript because fortunately it can't debug Silverlight and javascript at the same time. You can now attach your javascript to the browser debugger.
This problem was appearing when I started pdf viewer. I reinstalled this program in other folder (another disc in comp) and in my case it worked.

Visual Studio 2010 Debug Server Not Recognizing My Changes

Using Visual Studio 2010 on Window 7 64bit. I'm trying to test a website project (not a web application project) using the built in dev server (cassini). The problem I'm having is that when I make a change, I now have to actually stop debugging, kill cassini, and restart before I can actually see my changes in the browser. I used to be able to edit and refresh. One of my fellow developers here is able to do this just fine with an identical setup (same project/vs version/os - and settings near as I can tell). I'm beginning to suspect some sort of permissions issue. I've been all over google trying to find an answer to no avail. Any ideas?
As it turns out, this was my fault... I had experienced the dreaded "network BIOS command limit has been reached" issue. I found a post that recommended doing a regedit hack "HKLM\Software\Microsoft\ASP.NET\FCNMode = 1", well this basically turns off File Change Notifications. Changing this value to 2, and applying the changes recommended in knowledge base 810886 fixed both problems.

why does windows installer start up everytime i start up visual basic 6

it starts up windows installer with random applications on my machine . . after i click cancel a few times, it loads vb6 fine.
any ideas why this is happening?
To stop this behavior:
Start VB6
Open the Add-Ins dialog
Uncheck the "Visual Component Manager" Add-In
Source:
After VS2010, SP1, VB6 launches VS2010 installer
This is what a Windows Installer repair looks like. It means that something is broken in one of the installed products on your system. Ideally it's a one-off repair so you might be better off letting it runs its course and do the repair, except of course if it asks for a install CD that you don't have.
The Windows event log (Application) will have MsiInstaller entries saying what product and component has the problem.
It's possible a previous installation has not completed correctly.
Use the utility at the following link to remove any rogue installations files:
http://support.microsoft.com/kb/290301 (broken link Aug.2017, leaving URL for "historical purposes").
As PhilDW has pointed out this is a Windows Installer Self-Repair issue, and can often be resolved by allowing the self-repair to complete once. At other times the problem persists and it should be fixed by other means. Even when the self-repair completes and the problem goes away, it can still resurface once you launch the conflicting application. Windows Installer is not easy to deal with.
In your particular case you might be able to get away with a "workaround" rather than a fix. By locating the main VB6 EXE file on disk (in its main installation directory) and manually creating a shortcut to it on your desktop, you might be able to successfully launch VB6 via this new shortcut without the self-repair kicking in. It might be worth a try.
This shortcut trick will not remove the underlying problem, but might help to "bypass it". Just for the record: the reason this might work is that the new, manually created shortcut is not "advertised" and will not trigger a key-path check of the installed product when launched. This is Windows Installer's way to verify that a product is correctly installed. Note that even if the workaround works, self-repair might still result during application use because of faulty COM data being detected (which is very likely the cause of the whole problem you are seeing, but give the manually created shortcut a try).
There is a rather comprehensive "article" on self-repair here: How can I determine what causes repeated Windows Installer self-repair? which might help to track down the cause of the self-repair kicking off in the first place, but fixing it can be a rather complicated process (so try the workaround first). It is a long article because there are so many different ways self-repair can occur. The common denominator is that different installers on your system are fighting over a shared setting that they keep updating with their own values on each application launch in an endless loop. The last application to launch will overwrite the registry or file system with its own setting.
This worked for me, for VS2010 RC:
"Please wait while windows configures Microsoft Visual studio 2010 Ultimate."
THe work around that fixes the issue for me was to run the following via the admin cmd prompt.
Md "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\common7\IDE\FromGAC"
from http://social.msdn.microsoft.com/Forums/en-SG/vsprereleaseannouncements/thread/572a0f8a-16b0-4e1d-b581-16be36a9b564
This was also happned to me.
Whenever i tried to open vb6, it started windows installer to configure "Autocad".
Autocad had not broken. and it was working fine.
I tried removing and reinstalling Windows Installer, But it did not solved the issue.
Then i installed Microsoft's "Windows Installer Clean Up Utility 2" from given link.
Using this utility i removed the autocad from "Windows Installers" Database.
After that VB6 never started installer again.
Keep in mind 'removing any entry from installer's database may be risky, but i had no choice. So do it on your own risk.
Download "Windows Installer Clean Up Utility 2" (this is a deprecated, unsupported and unsafe tool to use - Aug.2017. I will leave the link in for "historical purposes", don't use it).

Resources