Visual Studio debugging/loading very slow
Solution 1
Here is how I solved the "slow symbol loading" problem in Visual Studio 2012:
Go to Tools -> Options -> Debugging -> General
CHECK the checkmark next to "Enable Just My Code".
Go to Tools -> Options -> Debugging -> Symbols
Click on the "..." button and create/select a new folder somewhere on your local computer to store cached symbols. I named mine "Symbol caching" and put it in Documents -> Visual Studio 2012.
Click on "Load all symbols" and wait for the symbols to be downloaded from Microsoft's servers, which may take a while. Note that Load all symbols button is only available while debugging.
UNCHECK the checkmark next to "Microsoft Symbol Servers" to prevent Visual Studio from remotely querying the Microsoft servers.
Click "OK".
From now on, symbol loading should be much faster.
Note that if you make any changes/downloads to Microsoft assemblies, you may need to go back into the Symbols dialog box and "Load all symbols" again.
Solution 2
Turning off intelliTrace fixed this for me.
In Visual Studio, Tools -> Options -> IntelliTrace
Then, uncheck the checkbox for "Enable IntelliTrace".
Solution 3
None of this worked for me but I found a Breakpoint on a symbol that was deleted. Seems 2010 was hanging on it. To see if this is your issue do debug->windows->breakpoints If any are in there just delete them.
Saunders, mentioned he checked for that but it was not mentioned in the solutions for this problem. Maybe common knowledge for some, but not all of us.
Solution 4
I deleted the "Temporary ASP.NET Files" folder and my localhost page load improved dramatically. Here is the path... %temp%\Temporary ASP.NET Files\
Solution 5
I experienced the same problem and tried most of the resolutions above. Simply deleting cache and temp files end up working for me.
Try removing the contents of these two folders:
C:\Users\\{UserName}\AppData\Local\Microsoft\WebsiteCache
and
C:\Users\\{UserName}\AppData\Local\Temp
(in particular the iisexpress and Temporary ASP.NET Files folders).
This can be set up to happen automatically on logging on to Windows by adding a cmd file to the C:\Users\\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
folder with the following content:
rmdir C:\Users\\{username}\AppData\Local\Microsoft\WebsiteCache /s /q
rmdir C:\Users\\{username}\AppData\Local\Temp /s /q
Ber'Zophus
Updated on July 08, 2022Comments
-
Ber'Zophus almost 2 years
I'm at wit's end. Visual Studio is typically painfully slow to debug or just plain load ("start without debugging") my ASP.NET MVC sites. Not always: at first, the projects will load nice and fast, but once they load slow, they'll always load slowly after that. I could be waiting 1-2 minutes or more.
My setup:
I'm using Visual Studio 2012 Express, currently, but I've had the same problem in Visual Studio 2010 Express as well. My solution is stored on a network drive; specifically, it's My Documents redirected to a network drive, if it matters. (It shouldn't. There are times where my site loads very fast under this setup.)
I load in Internet Explorer 9 usually, but the same problem happens in Firefox.
This can happen in any ASP.NET MVC project I work on, and it seems to revolve around having DisplayTemplates, which all my ASP.NET MVC projects do. And it's all C# and Razor if that mattered.
Symptoms:
The system will load my symbols hundreds of times. Basically, the following, but there are at least 300 such rows, each with ever-so-slightly different DLL files for the same CSHTMLs:
'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_contact.cshtml.22013bb9.xighmhow.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_contact.cshtml.22013bb9.cv5hktkf.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_statuscode.cshtml.22013bb9.1o77hs8i.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_statuscode.cshtml.22013bb9.jja-77mw.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_location.cshtml.22013bb9.l_e9ev_s.dll', Symbols loaded. 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_location.cshtml.22013bb9.b4n59gom.dll', Symbols loaded.
In the above, I've got three DisplayTemplates: "Contact", "Location", and "StatusCode". It appears that IIS is loading symbols twice for each time the display template gets called. Thus, if I'm displaying a table of 100 entries that call all three of these display templates, it's 600 separate symbols loaded.
This isn't a fast operation either. The log files that IIS generates take about 200 ms for each symbol to load. Thus, super-long delays.
What I've Tried:
- Debug or Release version, it doesn't matter.
- Putting my project on a full IIS implementation on a web server runs it super fast with no problems.
- Cassini, IIS Express 7.5, and IIS Express 8.0 all have the problem.
- Delete All Breakpoints does nothing.
- Clean Solution, or deleting the .suo also do nothing.
- If I repair IIS Express, or delete the
My Docs\IISExpress
folder, or repair/reinstall Visual Studio → the issue MAY go away, but only for a while before it comes right back.
Any advice at all is appreciated.
To answer more questions, yes my machine definitely has horsepower. The infuriating thing is that the same project, with NOTHING altered, can sometimes load very quickly, typically after I repair IIS Express and delete the
My Docs\IISExpress
folder. Eventually, "something" happens and it's down to 2 minutes to load again. What I'm working on is not a complicated project. No external libraries or dependencies and my VS.NET has no add-ons what-so-ever.Of note, this machine has Symantec Endpoint Protection, which has a history of causing havoc. But disabling it outright (it's good to be an administrator) did not fix the problem.
I have a theory at this point. I'm thinking this is all because I'm working off a redirected folder off a network share. While the debugger was going through its hundreds of "loaded symbols" lines, I paused to see what it was doing. It was in my code, loading the DisplayTemplate I had. Stepping into the template output this:
Step into: Stepping over non-user code 'System.Threading.WaitHandle.InternalWaitOne' Step into: Stepping over non-user code 'System.Threading.WaitHandle.WaitOne' Step into: Stepping over non-user code 'System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated' Step into: Stepping over non-user code 'System.CodeDom.Compiler.Executor.ExecWaitWithCapture' Step into: Stepping over non-user code 'Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch' Step into: Stepping over non-user code 'Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch' Step into: Stepping over non-user code 'System.Web.Compilation.AssemblyBuilder.Compile' 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_statuscode.cshtml.22013bb9.bciuyg14.dll', Symbols loaded. Step into: Stepping over non-user code 'System.Web.Compilation.BuildManager.CompileWebFile' Step into: Stepping over non-user code 'System.Web.Compilation.BuildManager.GetVPathBuildResultInternal' Step into: Stepping over non-user code 'System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert' Step into: Stepping over non-user code 'System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory' Step into: Stepping over non-user code 'System.Web.Mvc.BuildManagerWrapper.System.Web.Mvc.IBuildManager.FileExists' Step into: Stepping over non-user code 'System.Web.Mvc.VirtualPathProviderViewEngine.GetPathFromGeneralName' Step into: Stepping over non-user code 'System.Web.Mvc.VirtualPathProviderViewEngine.FindPartialView' Step into: Stepping over non-user code 'System.Web.Mvc.ViewEngineCollection.Find' Step into: Stepping over non-user code 'System.Web.Mvc.ViewEngineCollection.FindPartialView' Step into: Stepping over non-user code 'System.Web.Mvc.Html.TemplateHelpers.ActionCacheViewItem.Execute' 'iisexpress.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b63f8236\6775085d\App_Web_statuscode.cshtml.22013bb9.kwj3uqan.dll', Symbols loaded. Step into: Stepping over non-user code 'System.RuntimeType.CreateInstanceSlow' Step into: Stepping over non-user code 'System.Web.Mvc.DependencyResolver.DefaultDependencyResolver.GetService' Step into: Stepping over non-user code 'System.Web.Mvc.BuildManagerViewEngine.DefaultViewPageActivator.Create' Step into: Stepping over non-user code 'System.Web.Mvc.BuildManagerCompiledView.Render'
It looks like Visual Studio is recompiling my display template every time it's called, which is again, hundreds of times. My theory is that Visual Studio compiles the file, saves it to the network share, then somehow stamps a new time on it, and Visual Studio then thinks the file has changed. Thus, Visual Studio recompiles it yet again. Only a theory though; I really have no clue.
For one, apparently, I have offline files on (this is a desktop computer in an office; I couldn't care less). I'm going to disable, reboot, and retry tomorrow.
Plus, moving my project, as is, to the local C: fixes it. It loads very quickly. But this is not ideal in a work environment. I lose Previous Versions, my code isn't backed up at all unless I manually copy it, and it's no longer shared with anyone.
I can make do with copying it back and forth from C to the network share if it comes to it. It's much more annoying to wait two minutes for every page load.
-
Mike Mooney over 11 yearsAwesome that fixed it for me too. I had turned all of that symbol stuff on a while ago to step through the MVC source
-
Ber'Zophus over 11 yearsNo fix for me I'm afraid. This would be a good solution for those revolving around issues with Microsoft symbols. Unfortunately for me, my problem seems to revolve around my own symbols. Those symbols already cache locally, and for some reason, compiled hundreds of tiles in just one page load.
-
Ber'Zophus over 11 yearsMine's already set to that unfortunately, so no fix for me. But could be good advice for others to try.
-
Chris McGrath about 11 yearsthanks for this tip one problem i am having here is the load all symbols button is disabled for me any ideas?
-
Bobby Tables about 11 years@ChrisMcGrath try this link social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/…. Btw thanks for the great answer
-
Ber'Zophus about 11 yearsOk, seems this is helping most with this problem so I'll mark it as the solution. Personally, I just gave up working off a redirected network share and do my coding locally now & manually back it up. A pain, but far less a pain than waiting 2 minutes for every page load.
-
Andrius Naruševičius about 11 yearsWhere do I send you a paycheck for the incredible amount of time saved for me?
-
Muhammedh about 11 yearsTried this on a Windows Server 2012 (8 GB) + VS 2012 + SharePoint 2013 and it did not help.. Any suggestions please?
-
Himanshu Aggarwal about 11 yearseven after following your steps, the "Load all symbols" button is hidden and I cannot click that. What should I do now? I am using VS Express 2012.
-
David Airapetyan almost 11 yearsI started having this problem in VS2010 out of a sudden, and it was, indeed, one of my breakpoints that was causing it. As soon as I cleared my breakpoints, it became fast again.
-
Nathan Palmer almost 11 yearsI just performed the first 2 steps here and it works much faster. Seems like previously I had unchecked that box.
-
pleunv over 10 yearsJust had this exact same thing myself. Nearly drove me crazy. Why on earth does an inactive breakpoint in a web.config file completely break debugging?
-
mpeterson over 10 yearsThis fixed my problem as well. I was getting complete system lockups when trying to debug, especially when using the QuickWatch window. LastPass Toolbar needs to be disabled. (IE 10.0.9200.16635)
-
QFDev over 10 yearsWow..VS2012 was crawling, 5 mins just to build a simple project. Cleared all the breakpoints and it's lightening fast again, thanks!!
-
SomeoneRandom over 10 yearsI know this is a bit old news, but I had this same problem. My team suggested I use a build script that copied over files from my local source to where the files were being run and every time I ran that subroutine by itself it would create a conhost.exe and not close it. Once I ended all the extra copies of that it ran lightning fast again.
-
Dr Rob Lang over 10 yearsThis worked for me. Intellitrace slowed VS2012 to a crawl such that a brand new MVC4 site would timeout on first run.
-
Gwynnbleid1 over 10 yearsHere is solution for those who have button Load all symbols disabled: Button is only available while debugging.
-
awj over 10 yearsI found out the hard way that this was causing my problem too. Only after disabling the extension did I look to see if anyone else had noticed it.
-
nawfal over 10 years+1. I wouldnt recommend it though. See here what it means: stackoverflow.com/questions/8174800/…
-
Paul Bullivant about 10 yearsI had this problem when stepping through one of my unit tests. It took about 300 seconds with intellitrace turned on and about 14 seconds when it was turned off. This fix really worked for me.
-
James Ellis-Jones about 10 yearsImproved my startup from 25 secs to 6. I think it helped a lot because I was running a lot of my own code on application start
-
Sean about 10 yearsAnd this is why I love StackOverflow. But LastPass should fix this - I'm emailing them now to let them know. It's obviously still a problem with VS2013 and IE 11. Disabled LastPass and back to normal. Thanks to UserBlueOne for the info - can get on with work again.
-
VilladsR about 10 yearsThis didn't help me. I found the following solution working for me. Choose remove all breakpoints: stackoverflow.com/questions/3377720/…
-
JB06 almost 10 yearsAfter reading this and following what you said, I found a breakpoint that somehow got placed in the XML code of one of my edmx entity files. You da man/woman.
-
Tony almost 10 yearsFREAKEN LASTPASS! My keyboard was completely stuffed when debugging in VS 2012 with my MVC app. Disabled LastPass and everything flew again. THANKS! Upvoted.
-
Ian Thompson almost 10 years@VilladsR Yes! Perfect. Went from a 45 seconds start up to 1. Thanks muchly.
-
Leniel Maccaferri over 9 yearsUhmmm... very nice answer. I was on the same boat. I also enabled
FusionLog
a long time ago and forgot to disable it. Now debugging theASP.NET MVC
app is a lot faster. Thanks God and @rkawano. :) -
Peter over 9 yearsIn Win8.x with IE if you use MS account for login you can have it sync your logins so no need to use LastPass but still have (partially) the benefits, :)
-
Kevin Cloet over 9 yearsGoddamnid... From 1 min to 10 seconds. It's selected by default in VS2012 Ultimate. Watch out guys
-
AH. over 9 yearsUnfortunately not a fix that worked for me. VS2013 is still sometimes extremely slow at starting up and running in debug mode.
-
Simcha Khabinsky over 9 yearsThis also improved my code speed tremendously. All "deep" code was able to run much faster.
-
Rita over 9 yearsI followed the above steps... It helped me on VS2010. Thank you so much.
-
Nelson Rothermel about 9 yearsUnfortunately running as administrator is required if you have your projects set to run in IIS.
-
Shiva Naru about 9 yearsThis worked. "AppData" folder is a hidden folder, just in case, someone is unable to find it.
-
Shiva Naru about 9 yearsC:\Users\{USER_NAME}\AppData\Local\Temp is the path and "AppData" folder is a hidden folder
-
Geeky Ninja almost 9 yearsThis issue was really painful, I followed steps provided by you and without deleting any temporary files and restarting VS, debugger is loading perfectly. Kudos!! to you Zeb Kimmel.
-
Kanapolis over 8 yearsThank you for posting. This actually did more to improve my performance than the accepted answer.
-
Ian Warburton over 8 yearsHow could this solve the problem when it was occurring during a release build?
-
Vaibhav Patle over 8 yearsThanks a ton. This resolved my issue with very slow performance of VS2010.
-
RitchieD about 8 yearsI found 1GB of old crap here....delete it all and VS running a little better. :)
-
IDIR Samir about 8 years@Ber'Zophus can you try this one and share with us your results?
-
Shelby115 about 8 yearsRestarting made it take 5x longer than normal instead of 10x longer than normal. Deleting the .suo file made it nearly instant startup. Thanks!
-
Yablargo almost 8 yearsIntellitrace disabling really helped me.
-
thnkwthprtls almost 8 yearsI know "Thank you" comments are a bit frowned upon here, but seriously, THANK YOU SO MUCH. This one change took the program I'm testing from slow to the point of being unusable to essentially instant reactivity. You probably bought me about an hour or two per day of productivity just for not having to wait around for things to load
-
Nic almost 8 yearsI just realized that I got vs slow after power outage as well, thanks so much for this answer.
-
hal almost 8 yearsYeah, turning off windows defender works like a charm! To permanently turn off windows defender in Windows 10, set Start="4" (4 is for disabled) in the RegEdit path HKLM\System\CurrentContolSet\Services\WinDefend
-
hal almost 8 yearsThis stuff with turning off windows defender helps me!
-
LazyZebra almost 8 years@thnkwthprtls you're welcome - one of those MS default settings you need to watch out for :)
-
shireef khatab over 7 yearsCan`t find Intellitrace in Tools => Options. .. i have vsComunity 2015
-
shireef khatab over 7 yearsalso, vs is slow a bit when trying to open a file
-
NoelC over 7 yearsHaving been through this entire topic, I can say that there IS a persistent Windows condition that crops up and leads to slow symbol loading. Maybe it's some kind of resource exhaustion, I don't know (it's not obvious). It doesn't seem to affect anything to the point where there is a failure - but it DOES cause symbol downloads to be slowed way down. And yes, a reboot clears it right up. After 22 days uptime I have this condition and I'm investigating it right now before resorting to reboot.
-
Mike Manard over 7 yearsThis just helped me resolve the same issue for Visual Studio 2015. Thanks!
-
AXMIM over 7 yearsHow long should it take to load all symbol? It's been running for minutes now.
-
HK1 over 7 yearsIn Visual Studio 2015, Intellitrace exists only in VS 2015 Enterprise Edition.
-
Owl over 7 yearsThe problem is now, everytime you debug it takes forever to load symbols.
-
Graham Laight over 7 yearsThis is the one! It works so well that I now make it happen automatically when I log on to Windows: I have added a file called DeleteVisualStudioCache.cmd to C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup with the following commands: rmdir C:\Users\{username}\AppData\Local\Microsoft\WebsiteCache /s /q rmdir C:\Users\{username}\AppData\Local\Temp /s /q pause
-
Niloofar over 7 yearswhere is this "Load all symbols" button?
-
Skipper over 7 years@Niloofar in Tools -> Options -> Debugging -> Symbols, mind that it's available only during while debugging
-
purplecat over 7 yearsThis also worked for a slow debugging problem I had in Visual Studio 2015.
-
Peter Mortensen about 7 yearsIndeed they do. But only if the lines containing them are actually executed.
-
Graham Laight about 7 yearsHaving the issue with AVG antivirus. Has anyone worked out if a particular folder can be excluded from antivirus to resolve the problem, please? I've cached symbols, and have excluded the symbol cache folder - but this made no difference.
-
SliverNinja - MSFT almost 7 years
value == symsrv*symsrv.dll*C:\WINDOWS\Symbols*http://msdl.microsoft.com/download/symbols
still no dice! -
A. Morel almost 7 yearsIt's not necessary to disable it, see my answer => stackoverflow.com/a/34979659/2736742
-
Flappy almost 7 yearsSolved it for VS 2017! Awesome!
-
Groo almost 7 yearsYes, this fixed it for me too. It's mentioned here also (I think this is the same registry setting).
-
The One almost 7 yearscompilation goes inside system.web
-
Nerfpl almost 7 yearsThis saved my project. I ended up with 30+ seconds to run relatively small app. Really annoying. Now it's almost instant. I actually noticed change straight away when i changed symbols folder. Maybe old one was "corrupted" Thanks!
-
David Silva-Barrera almost 7 yearsI have VS 2013 and it has IntelliTrace too, and the proposed solution worked for me just right now, by the way.
-
kasparspr over 6 yearsConfirmed to work for large solution and web application (MVC) within.
-
Frank Myat Thu over 6 yearsThis one is the most fastest one
-
Ryan over 6 yearsThis significantly increased my startup time.
-
SharpCoder almost 6 yearsSeems like deleting .suo file worked. Any reason deleting this files helps boosting performance.?
-
Geeky Ninja almost 6 years@SharpCoder .suo contains a lot of information such as which files are currently open in the IDE, debugger info, local settings, etc. And when this files will corrupt, vs start consuming more CPU usage which leads to VS slow and even hang in some cases.
-
Soleil over 5 years@NelsonRothermel Which version ? Not anymore (VS2017).
-
Nelson Rothermel over 5 years@Soleil: In VS2017 it's still required. IIS runs as a Windows service (or set of services) and not in the user space. You may be referring to IIS Express which doesn't require administrator rights. I'd generally recommend you use the latter, especially in an organization that locks down machines, but it does have a few downsides.
-
Soleil over 5 yearsyou can keep the AV and exclude from analysis certain path and targets (VS and your projects)
-
Fahad over 5 yearsI've been struggling for the past few hours, this has been a life-saver! Thanks a ton!
-
William Walseth about 5 yearsThanks, this worked. Also resolved localhost ssl issues for me.
-
Hrvoje almost 5 yearsThat fixed it for me!
-
Luke Maurer over 4 yearsThis … worked for me. Please note that it is now 2019---six years later---and I'm using the LastPass plugin with Microsoft Edge.
-
CAD bloke over 4 yearslook for a
.vs
folder in later versions of Visual Studio. Delete that. -
Mike Pelton over 3 yearsFixed it for me in VS2019 Community (i.e. years later!) - many thanks. Does anyone know how another debugger registers itself? Is this fall out from remote debugging?
-
Victor HD over 3 yearsMan thaks a lot! I can work muuuuuuch better now, as brazilians says: 'you are the guy'!!
-
Christopher over 3 yearsCan't find the "ForceLog" key - guess it's gone in Win10?
-
rkawano over 3 years@ChristopherD.Emerson If you are not seeing this key, you certainly haven't enabled fusionlog.
-
Anders Lindén over 2 years"CHECK the checkmark next to Enable Just My Code" does not specify whether to check it or uncheck it.
-
apinostomberry almost 2 yearsDear poster. I could kiss you. You just saved my bacon.