Visual Studio 2010 closing a tab takes 8 seconds? - visual-studio

Anybody else's VS2010 is extremely slow when closing code editor tabs?
Opening a .cs file is instantaneous but closing a tab takes ~8 seconds. I have uninstalled Power Commands and the Productivity Power Tools, the only other installed extensions are ReSharper (disabling it did not help) and the Color Theme Editor. I do have the UI Automation Performance Fix installed.
I tried most suggestions from Visual Studio Optimizations question; made sure the settings are saved locally; disabled the outlining mode; disabled the Anti-Virus -- nothing helps.
Googling only finds generic "VS2010 is a pig" complaints back from the Beta1 times. I even tried installing a few recent hot-fixes from https://connect.microsoft.com/VisualStudio/Downloads (KB2201993, KB2123002, KB2106584, KB981107, B2268081) but nothing seems to help.
Any ideas anybody?
--UPDATE---
Another clue: it only seems to happen for some solutions but not for others! Why would it be solution-specific?!!

Deleting .suo file helped!
Similar case was reported here but it involved a huge .suo file while mine was <1Mb
Another mention of similar problem can be found here in their case it was the debugger that was impacted.
Thanks to Sysinternals ProcessMonitor for the clue!

I know you already tried disabling antivirus, but I wanted to post what worked for me. We're inflicted with Symantec Endpoint Protection where I work and I fixed the problem by excluding the solution's folder(s) from auto-protect. Closing file tabs in VS2010 used to take several seconds, now it's nearly instantaneous.
Here's how: Under your Symantec's Antivirus and Antispyware Protection -> Options -> Change Settings -> (tab) File System Auto-Protect -> Centralized Exceptions -> Add...[your folder(s)].

After half a year suffering, I just discovered that adding the project's folder to Security Essentials' excluded files & folders list clears this problem for me. Removing the exclusion brings the problem back.

I was having this same issue. used procmon to find that visual studio was slamming my solution's .suo file. I deleted that file and immediately my file closings are immediate. no more 60 second closing all files!!! Man, MS needs to fix that problem, It's very bad.

Related

Visual Studio 2013 Update 2 kills cshtml performance in large solution

I have just moved an Asp.Net MVC project into our main solution, straight away the performance in cshtml files is incredibly slow, you can see each character appear after a 1 second delay. Also switching between .cs files also takes 1 second.
Outside of this solution performance is fine, this solution holds a number of projects which my solution references.
The problem occurs on 2 machines which have Update 2 present, a machine that doesn't have Update 2 present doesn't get the problem
Neither my machine nor the others use any plugins
Obviously I have a workaround, just do my coding outside of the main solution but has anyone else experienced this?
thanks
I have had similar issue with performance of some files and found it to be Plugin related. For my setup the issue was Web Essentials 2013 needed to updated.
If that doesn't work, try disabling all of your plugins, especially and large ones like Resharper (and Resharper plugins!), restart VS and see if the problems are resolved. Then renable plugins until you have found the culprit.
I can make it freeze simply by putting a debugger keyword in a ts file, as soon as it hits it it freezes VS for a good minute, there are other problems all seemingly related to .ts files.
I went up to RC3, no change. Uninstalled and went back to VS2013 without any updates and it now works fine
NB RC3 did -not- help it at all
Just to be clear, I have never installed Web Essentials and this is now VS2013 with "microsoft.com/en-gb/download/details.aspx?id=34790"; installed

Unable to save changes to files in Visual Studio 2013

I have a Visual Studio 2013 solution that is under source control (TFS, Visual Studio Online). It is mapped to a local workspace, I have checked out some files (e.g. web.config, global.asax).
When I try to save any changes to files I get a 'Save File As' dialog, and if I hit Save it warns me the file already exists (say, web.config), and asks me if I want to replace it. If I hit Yes I get I get an error dialog saying 'the process cannot access the file '....\wyfvmjia.p1p~' because it is used by another process. I have no idea what this file is or how it is related to the file (web.config) I am trying to save.
This is infuriating, any help would be greatly appreciated!
EDIT 1:
It looks like the Visual Studio process (devenv.exe) is creating and deleting random temporary files in the same folder (e.g. wyfvmjia.p1p~) and is causing a 'sharing violation' on those files (I used a sys internals utility to monitor the folder) when I am trying to save let's say web.config.
EDIT 2:
This seems to suggest in one of the comments that VS2013 creates a copy of a file and then replaces the original when trying to save a file in your project. This would explain why I see temporary files getting created and deleted. It's odd I get the 'Save File As' dialog though. It looks like some other process (antivirus?) gets hold of the temporary file before VS can do something with it?
EDIT 3:
I created a console application project with only a program.cs file and the same is happening. This may be a problem with Antivirus software interfering with the VS2013 'copy-replace' feature.
EDIT 4:
Changed title. Still have not been able to find a solution.
EDIT 5:
See the accepted answer. Apologies for not getting back earlier.
For me it was Google Drive.
Once I've closed it, I was able to save the file.
Try running Visual Studio as Administrator.
Extensions might be the problem. Or you could be opening some readonly files.
It's worth to mention that some of the extensions can turn any file you create in to a readonly file, and this would be the same result that you're facing.
So first, disable all extensions, and check for the little icon near the files's name (in the tab) that indicates a readonly file.
It turns out this was caused by disk encryption software. Disabling the disk encryption software services each time after starting VS2013 solves the problem. I did not have this problem with earlier versions of Visual Studio, presumably because of the new copy-replace cycle adopted by VS2013 mentioned in EDIT 2 in my original question.
Apologies for not coming back to comment and answer my original question, I completely forgot about it.
I had the same problem and it was caused by "Backup and Sync from Google". After I’ve closed it everything went back to normal.
I had this problem as well. It went away once I uninstalled VS 2013 and installed VS 2012 instead. Good enough for me.
I had the exact problem on a company computer. I had to uninstall VS 2013 RC2 and reinstall vs2013 ultimate. Then I had to go through the update process for update 1. I believe it must by the Symantec progressive scan along with the VS 2013 upgrade handling of files. I guess the moral of the story, if I can be so cliché is "If it aint broke don't fix it".
I had the same issue and created a bug on Connect. Let's hope this gets fixed
https://connect.microsoft.com/VisualStudio/feedback/details/860265/unable-to-save-files-in-vs-2013-update-2-rc2
I got mine fixed by making a copy of all the files with git clone then deleting all old files and pasting the copied versions over it. Not sure how this fixed permissions or an antivirus denying permission but it did
martijn_himself sounds correct, problem could be because of Disk Encryption Software. This problem started om my PC when i changed settings (domain etc) on Disk Encryption Software. and a simple "Update 2" for VS2013 fixed this issue.
I had the same problem with only one html file in a project. For me it seems to have something to do with VPN that I was using to upload this html file to CRM system. Whenever it was on it seemed to "block" the file somehow. When I closed the window where I was uploading the html file I can save without any issues.
I tried all the suggestions here but none worked. Then, with the modified file open in Visual Studio, I navigated to the file on disk and deleted it. Then clicked build and the save file dialog no longer popped up. I was able to build and check in.
For me, it was Windows' Controlled Folder Access, even though I didn't get the standard warning/error. In "Allow an app through...", I had to add
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\WDExpress.exe
(Backup and Sync from Google) when I close it The problem vanished

Visual Studio 2013 hangs when opening a solution

I installed VS2013 (v12.0.21005.1) and added ReSharper 8 (v8.0.2000.2660) a day or two ago. That day it was fine. Now I'm lucky if I can get it to open one solution in a whole day. It opens OK by itself, but when I try and open a solution from within - via the menu - it hangs, badly. If I right-click a solution in Windows Explorer and 'open with VS 2013', it opens then hangs, in exactly the same way. Every now and again, for hours, I get a little notice that it's busy with something.
Anyone know what could be wrong, before I endure a reinstall that doesn't fix the problem?
Sometimes it's enough to simply delete the ".v12.suo" file and try to open the solution again. Helped me many times when VS2013 was freezing on loading a project.
Deleting all ".suo" files worked for me. There were several copies due to opening the solution in multiple versions of Visual Studio.
Edit:
Possible path could be:
PathToSolution\.vs\ProjectName\v14\
.vs may be a hidden folder.
.suo is filename.
Basically it could be anything, but you can try a few things:
Turning it off and on again.
Clear the ReSharper cache, it's in %LOCALAPPDATA%\JetBrains\ReSharper\<CurrentVersion>\SolutionCaches, where you should find a folder matching the solution you are trying to open. Just close all instances of VS2013, delete the folder and try again.
turn off ReSharper: Tools > Options > ReSharper > General > Suspend
uninstall ReSharper completely and see if problems persists.
Repair Visual Studio through Programs and Features.
I found the following to be the better approach to debugging VS based on MS Connect instructions
Please help to confirm if your captured dump file is a 32-bit dump file. If it is a 64-bit dump file, please use the following step to capture a new dump file.
Start Visual Studio.
Start another instance of VS.
In the second instance click Tools | Attach to Process...
In the list of processes locate devenv.exe.
Click Select... and explicitly choose 'Native' and 'Managed' code.
Click OK and OK to close Select dialog and Attach to Process dialog.
Go back to the first instance of VS and repro the hang.
Upon the hang, control should go to the second instance of VS. If not please go back to the second instance of VS manually, and hit "Break All".
In the second instance click Debug | Save Dump As Minidump with heap.
If you are running the VB profile you will not see the Save Dump As menu item. To add this menu item:
Select Tools -> Customize
Select the Commands tab
Select Debug from the Menu bar dropdown
Click Add Command...
Select Debug from the Categories list.
Find the Save Dump As entry in the Commands window.
Click OK (the Save Dump As... command is added to the top of the Debug menu).
Click Close
You can get detailed steps about how to get the dump file and call stack at http://blogs.msdn.com/debugger/archive/2009/12/30/what-is-a-dump-and-how-do-i-create-one.aspx
If you find the problem is with Resharper Addin you can then report the issue via - http://youtrack.jetbrains.com/issues/RSRP
Suspending Resharper Worked for me.
Goto
Tools -> Options -> ReSharper -> General -> Suspend Now
Now your solution will load very fast.
After your solution fully loaded, you can change the Resharper settings to Resume Now.
Are you using any node modules in your project? Or can you identify that it is a ReSharper specific issue?
If you've got NPM modules (eg. for Grunt), mark your 'node_modules' folder as 'hidden' (no need to make child folders hidden though), and try again.
Visual Studio was hanging on open for me, turned out it was trying to scan deeply nested node modules with file paths longer than the Windows maximum (260 characters), and this was preventing me from opening the solution in VS, but marking the folder as hidden solved the problem.
I had this issue recently as well, and found that disconnecting my computer from the internet when loading the project fixed it. With this, I managed to cut loading times from several hours down to seconds. Since my network cable is not particularly accessible, I simply disabled my network adapter before loading the project (in Control Panel).
This soon became frustrating, however, and I recently looked into the problem again. It seems that logging on to my Microsoft account in Visual Studio ultimately fixed the problem, and I now have no more issues loading projects.
This may work for you as well (if you haven't yet fixed it - but since there is no accepted answer here, I assume that the problem is persisting), so I suggest that you at least try disconnecting from the internet, even if you would rather not enter your Microsoft credentials.
I went into the %LOCALAPPDATA%\JetBrains\ReSharper\
and opened all the directories looking for the SolutionCaches, and emptied all of them. Problem solved. The application was quite large, so this helped.
Check for Windows updates
I had this problem too. Furthermore, I couldn't open my Windows firewall settings (trying to block VS's internet connection).
When opening update settings (Windows 8), I saw there was a pending update ("found today"), so I rebooted my computer, letting Windows update. After that, VS and the firewall worked fine again.
Check your hardware
I've had the problem a second time; even Windows 8's update page would keep loading forever. It was an issue with my (non-OS) hard drive: https://superuser.com/questions/756261/various-parts-of-windows-8-and-visual-studio-2013-get-blocked-by-possibly-comm?noredirect=1#comment978074_756261
I get this issue now and again - VS 2013 Update 2, Win 8.1, IE 11.
Try this - Open task manger, kill the VS app hanging, and then close any IE sessions that are running in the Background Process list - there may be one or more hanging around.
Restart VS
Seems to clear it for me, without a reboot.
The problem I had was the Perforce connection.
When opening the solution, it would ask if I wanted it to connect to Perforce. Allowing it to try would make it hang and allocate 1.5 GB of RAM.
Not allowing the P4 connection let it load properly (allocating 1 GB RAM). Then I could tell it to connect to P4 after, and it is now fine.
For me , whether computer crashes with power outage, or sometimes with mandatory reboots in the middle of the night. What does WORK for me
DELETE ALL FILES IN THIS DIRECTORY:
C:\Users\yourusername\AppData\Local\Microsoft\WebsiteCache\
For anyone still referring this helped me:
I had to always delete .vs12.suo file to load the project.
I came across this thread from Microsoft and following that I created registry entry which fixed my issue with Solution load.
https://connect.microsoft.com/VisualStudio/feedback/details/860685/visual-studio-hangs-after-10s-when-loading-solution-corrupt-suo
I had similar issue, when i checked the solution file it was created by VS.Net 2012. To resolve the issue, I created dummy solution file and reloaded the projects from vs.net 2012.
Also observed when nuget package update got screwed up, while you reload the solution, Visual Studio might get hang.
The Visual Studio might go hang, when there was a problem in loading the nuget packages.
In my case, VS 2013 Professional was hanging on every startup, even without opening a solution because the license was no longer valid.
Last item in the log file:
<entry>
<record>367</record>
<time>2015/07/13 20:11:05.051</time>
<type>Information</type>
<source>UserConnection</source>
<description>myemailaddrs#gmail.com signed in for IDE user</description>
</entry>
And on the msdn.microsoft.com subscription page: "Your subscription is no longer active, contact your administrator."
I had to get an updated subscription from my employer.
Deleting Test Results from my TestResults folder actually did the trick for me. Just another thing to try.
VS2012 hangs on me e.g. when opening a csproj file on a network share (in fact on a share that was on the VirtualBox host, connected as a smb share using a VirtualBox feature).
Copying the project over to a local drive fixed it for me. Not sure if assigning a drive letter would do the trick.
Also not sure why it does not work via network share, if it is a VS limitation or perhaps some plugin (I use resharper, of course).
For me this appears to have something to do with the project having the MVC 4 project type guid (E3E379DF-F4C6-4180-9B81-6769533ABE47). Removing this guid from the .csproj resolved the hanging for me. (An additional wiping of the .vs folder was required after removing the guid.)
I just removed "packages" folder from root of solution and it helped for me (Visual Studio Express 2015)
Sorry for having to create a new post instead of commenting on the selected answer .. I do not have enough rep to comment at this time.
My issue was was temporarily resolved by the "...delete the .suo file ..." solution, and as other folks pointed out, I had to delete the file every single time.
Since it (apparently) is impossible to stop the creation of the file I started to dig a little more into what the file did. In addition to saving user settings, I believe it is also saving session settings, like which files you have open when VS is closed. I suspected that my project is attempting to open a file that no longer exists and that is what is causing the hang. What fixed things on my end was to delete the .suo, open VS, open a file within my solution, build and close the solution. After doing this I have had no hangs.
tl:dr
In my case, a user setting file(.suo) was attempting to open a file in my solution that no longer existed. I resolved the issue by performing the following steps.
Delete the .suo file (for me this was in /[projectfolder]/.vs/[projectname]/v14
Open Visual Studio
Open your project
Open a file (I simply opened a random .cs file)
Build and save your solution (Simply saving may do the trick, I built by habit)
Close Visual Studio
Hope this helps someone ... we spent way too many hours on this issue :)
Lots of suggestions here and elsewhere but the only thing that permanently worked for me had to do with the start-up project I'd set. This is what I did:
Delete the .suo file as suggested elsewhere.
Start VS and open the solution. All should be well at this point.
Leave the start-up project as-is, even if it's not what you want.
Save the solution. (Possibly do as someone else suggests and open a file, clean, build/re-build, etc, but I didn't have to do any of that.)
Close the solution and exit VS.
Re-start VS and open the solution.
Change the start-up project to whatever it should be
Save the solution. (Possibly again do the open file, clean, build/re-build, etc.)
Close the solution and exit VS.
Restart VS and re-open the solution and all should be well.
This might or might not work for you but I'd tried everything I could find - registry changes, debugging VS from a second VS session, you name it - but nothing else worked for more than a single start/open.
Try to uninstall extensions with "Control Panel" or disable any add-in in [Tools]=>[Add-in Manager] then try to reopen the solution.
My problem was fixed by uninstall "Visual Localizer".
In my case the Fusion log has been enabled. Log files has been growing for months as I forgot to turn it off after investigation. This way the antivirus software started to check these big log files several times during opening the solution, and "Preparing solution..." message is visible for long-long time. When I noticed this, I turned off the fusion log, and problem solved. Solution loads in 10 seconds instead of 20 minutes.
I've had this issue multiple times, in pretty much all versions of VS. The one solution that seems to work most of the times is to delete the .vs folder located in the solution folder. Sometimes it's enough to delete the .sou file located in .vs///
The folder is hidden by the way, so you will have to enable "Show hidden files and folders"
For me the solution was to disable source control (Set plugin to None in Tools->Source Countrol). I think it was trying to sync some huge Git repo for some reason (have a couple of massive repos, but not in the tree I was trying to open).
I have fixed the issue by uninstalling these two plugins:
Productivity Power Tool
Web Essentials
I restored a previous version of the .vbproj file and it solved it.
I don't know what was in the newer version but the problem was something inside the .bvproj file itself.

Visual Studio 2010 takes too long loading symbols, symbol file location cannot be removed

Visual Studio takes a lot of extra time loading symbols for external dlls which I'd rather not load. I have fiddled with my symbol settings in VS2008 and these settings seem to be affecting VS2010
How do I stop it loading 3rd party symbols?
I've tried:
devenv /resetuserdata
Tools > Options > Debugging > Symbols (I can't remove or uncheck the pdb file location of: "Environment Variable: _NT_SYMBOL_PATH")
I've cleared the above location like so: set _NT_SYMBOL_PATH=
actually this made a huge difference (it was previously SRVc:\symbolshttp://msdl.microsoft.com/download/symbols)
I've deleted everything from: %localappdata%\Temp\Temporary ASP.NET Files\root\
The next thing would be a VS re-install, failing that an OS re-install, but if it saves me 14 seconds every time I press debug it would be worth it.
Try Debug -> Delete All Breakpoints
Things to try
Tools > Options Debugging > General
Disable source server support
Enable just my code(just tested and greatly improved load times for me) -when to disable
Disable .NET framework source stepping (automatically disables just my code if selected)
Tools > Options>Debugging > Symbols
Only Specified Modules
Or All modules unless excluded and exclude those 3rd party
I was able to remove all checks under .pdb locations, but I had d:\refsrc\symbols as an added location
I had this trouble too. I did not think that I had set _NT_SYMBOL_PATH but somehow it was set to the path I use when using WinDbg. I figured this out by running ProcMon from the SysInternals Suite and filtered out everything except DevEnv.exe and saw what files it was trying to access when debugging my application.
I deleted the _NT_SYMBOL_PATH environmental, restarted VS and everything runs like it should.
I offer this not so much for the answer which was supplied in the initial question but as guidance on how to figure out what was wrong.
For me, I had previously turned on Debugging -> Symbols -> All modules and forgot to turn it off when I was done with a particular project. Turning off this setting greatly improved my load times.
I had this trouble too. And I fix it easily. Just do: Debug->Options and Settings->Symbols. In Symbols I checked Only Specified Modules. Everything works fine again. Hope this helps.

Howto Speedup Visual Studio(2005/2008) Toolbox initialization

Every time I open a windows forms application in VS .NET it takes minutes to initialize the Toolbox. Is there a way I can tell VS to cache this toolbox somehow?
Turn off AutoToolboxPopulate in Tools->Options->Windows Forms Designer->Tools.
The ToolBox has a nasty habit of collecting garbage. It was pretty bad in VS2005. But recently discovered that VS2008 suffers from it too. On Vista, navigate to c:\users\yourname\appdata\local\microsoft\visualstudio\9.0. There are some hidden files there. The toolbox_reset.tbd and toolboxindex_reset.tbd files seem to be backup files to get out real trouble, there to copy over the hidden toolbox.tbd and toolboxIndex.tbd files.
Take a look at the ProjectAssemblies folder.
This probably has to do with installed packages, try:
devenv.exe /ResetSkipPkgs
and then
devenv.exe /Setup
VS Toolbox consumes most time by going through installed Packages...
Opening the ToolBox the first time will certainly have a delay but it should only be the first time it occurs. If you are seeing repeated delays then it's likely one of the following.
A Plugin : What plugins do you have installed? Try uninstalling them and opening the toolbar a few times. That will eliminate the plugins as a suspect
A custom control: If you make custom controls they get added to the toolbox. It's feasible that this could be causing some performance issue (unlikely though). Try commenting out the functional code in the controls and see if that improves performance.
Deleting the .TBD from visualstudio\9.0 worked for me but result in a popup TFS30330: Team Explorer cannot write the to the project list configuration file. Also the files were recreated during VisualStudio2008 initialization but the initializing toolbox... does not occur. The TFS30330 error occurs each time i launch VS2008. I then had to reset my Visual Studio settings. But in the end it was worth it - no more forced coffee break as one blogger apptly put it.

Resources