Visual Studio 2010: very slow web applications debugging! - visual-studio-2010

I recently installed Visual Studio 2010 (Ultimate edition, final version released in April), and found that debugging a web application became very slow (2-3 times slower than in Visual Studio 2008)!
I took the same web application and checked the speed of loading of one of its pages in VS 2008 and VS 2010, and compared the time it takes to load the page.
I tested it using 2 approaches: 1) debugging under ASP.NET Development Server (by pressing the "Start" button) and 2) using ASP.NET Development Server without debugging (by using the "View in Browser" menu command).
And I got the following results for Visual Studio 2008 and 2010.
1) ASP.NET Development Server withoud debugging ("View in Browser"): the speed of page loading is the same in VS 2008 and 2010.
2) Debugging under ASP.NET Development Server ("Start" button): in VS 2010 the page takes more time to load than in VS 2008 - VS 2010 debugging is 2-3 times slower than in VS 2008!
3) At the same time, when debugging a web application in VS 2008, it takes the same time to load the page compared to when using only the "View in Browser" command. That is, VS 2008 debugging does not introduce any overhead to page loading in the web browser!
I wanted to make sure that other people have the same problem with slow debugging of web applications in VS 2010. Can this issue be solved by any means?
BTW, I am using Windows XP SP3.
Thank you.

Disable Intellitrace (historical debugger) - it enable jumping "back in time" during debug but it slows down debugging.
You can disable it from the options->intellitrace

Try 'Delete all breakpoints' from the Debug menu. It sped up my web application debugging by 10 times.

I had problems with slow Visual Studio debugging when "Native Code" debugger was enabled. Try disabling it.
On "Visual Studio 2010" go to:
Project Properties ->
Web ->
Debuggers (bottom of page). ->
Disable all exept ASP.NET
Hope it helps.
Similar question: 1

After incredibly slow debugging for months I finally discovered the cause (even after disabling intellitrace).
It turned out to be PC Tools internet security -> IntelliGuard -> 'Behaviour Guard'
This is a hips like protection system that monitors the 'signature' of system operations
I disabled this feature and wow what a speed difference - 'stepping into' lines of code in debug now has almost zero delay. I re-enabled Intellitrace and can use it with only a very slight speed hit.
Tino

I tried a lot of things and the only way to solve it was the swax solution 'Delete all breakpoints'

I had this problem as well and it turned out to be due to sybmbols.
Go to Tools > Options > Debugging > Symbols and uncheck any symbol servers

Deactivate the option Show Parameter Values in the callstack window (debug -> windows -> callstack -> left click).
It required lots of recursion.
Reference

I did find out what you have to do:
Disable Intellisense
Disable the Graphics Rendering Editor Function, this causes editor slowness
with some graphics cards.
Disable the Sourcecontrol that is set by default to the Microsoft Server Product.
I just can tell you, that VS2010 is a very good product, if you
know these few things, and setup this.

You can uncheck the Symbols servers.

Try removing the localhost from the list of trusted sites in IE security settings.
For me it solved the problem of slow JavaScript debugging in VS 2010. It may work for you if you have added 'localhost' (or any other domain name you use for local development) to the trusted sites list, like I did.

I can get it faster by clear all break points, all unnecessary variable in Watch windows, and all the unnecessary debug windows, such as CallStack ...

I realized that ESET Internet Security also makes lots of performance issues while debugging in Visual Studio 2010 using ASP.NET Development Server.

Recently I faced with the same problem. I noticed that I had too many messages (especially "A first chance exception ...") in the VS's Output window. I fixed those exceptions and everything went fine.

What is expensive too sometimes is debugging the JavaScript libraries you are using or developing.
Checking the option "Don't open a page" in the project property window allows you to debug the web application without debugging JavaScript. You simply have to open the web application in your browser manually.
In some circumstances debugging JavaScript can break the responsiveness of the debugging process and if you know that your concern is with the .NET debugging, you can make load time faster that way easily.

Taking another route of Paulius' answer (disabling "Native Code" debugger) I was able to speed up the debugging. Here are the steps I took for VS 2010 Pro:
1) Tools > Options > Debugging > General
2) Ticked Enable Just My Code (Managed Only)
3) Also this might help, unticking Enable address-level debugging

There is another trick you can do:
1) Go to (Ctrl + Alt + Del) Task manager > Processes
2) There are 2 main processes for visual studio debugging, 1)devenv.exe 2) WebDev.Webserver40.exe (Or similar).
3) Right click on each of the bove processes > Set Priority > Real Time. Click Ok in the message Box.
Speeds up debugging dramatically!.

Related

VS 2017 - Very slow (laggy) when debugging

When I debug my solution, vs 2017 is very laggy and slow it's like it has to operate something heavy in the background.
So it stops "responding" every 5 seconds for 2 seconds, which is very annoying.
Any suggestions?
EDIT (tried suggestions):
Browser Link is turned off
Stopped customer feedback
After some additional investigation I found this thread
Unchecking Enable Diagnostic Tools while debugging in Tools → Options → Debugging → General did the trick!
Unchecking Enable JavaScript debugging for ASP.NET in
Tools → Options → Debugging → General
makes a huge difference in performance.
If disable Diagnostic Tools don't fix the problem try to disable IntelliTrace,
Unchecking Enable IntelliTrace, in Tools -> Options -> IntelliTrace.
Work for me.
I have tried disabling few things myself just to see what is causing it. The only thing that did work for me is Tools > Options > Debugging > General > "Enable JavaScript debugging for ASP.NET (Chrome and IE)".
I'm using VS2017 Enterprise v15.2 for Asp.net WebForms.
Hiding the Threads window did the trick for me.
I also experience the lag when "Enable Javascript debugging for ASP.NET (Chrome and IE)" is checked. And Turning off the "Enable Diagnostic Tools while debugging" did not help.
However, I also noticed that when I F12 for Chrome Developer Tools, then lag time goes away and the app performs.
Hope this helps.
Only one thing that helped me was disabling Debugger option of Resharper.
If you use Resharper, try to UNCHECK "Show local variables values in editor" in menu: Resharper -> Options -> Tools -> Debugger.
It helped for me.
What worked for me was removing all the following folders in the solution's directory:
.vs
x64
Debug
Release
I experienced same problem. In debug mode, my webforms project ran very slowly. When using Ctrl+ F5, it ran quickly (as it does when deployed). I found a try/catch block that was executing 45 times. It wasn't doing anything, it was just trapping an error that I had made. I fixed the error and, when removing the try-catch block - voila! -- back to full speed.
So if you're experiencing this problem and you've tried all the solutions above (I did), look for a try catch block that is firing often. [ Fix your error :) ] and then remove the try-catch block. I can't believe the difference it has made. Shouldn't have made any difference at all, of course, since the try-catch block wasn't doing anything, but it did.
I also had this problem, for me helped disabling Enable Edit and Continue options in Tools → Options → Debugging → General.
I gave up getting Debug=>Attach To Process working... even tried ALL the solutions on this SO post (2-pages worth).
Solution
Use ReAttach VS IDE Extension. This bypasses the need to ever use the Attach to Process dialog again if it's a process you've recently attached to.
If you are using VS 2017 Enterprise edition, try disable IntelliTrace feature
(Tools -> Options -> IntelliTrace)
with this feature turned off, the laggy behavior went away even keeping the Diagnostic tools turned on (Tools -> Options -> Debugging -> Enable Diagnostic Tools while debugging)
Sometimes it is because of a Realtime scan in Antivirus.
"Add exceptions" Visual Studio files/folders for your Antivirus
C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ Common7 \ IDE \ devenv.exe
C: \ Program Files (x86) \ Microsoft Visual Studio \ 201
I had this problem where the program was running slower if started from visual studio, turned out to be too many threads, like alot of new System.Threading.Thread() in a loop etc. I switched the code to use the ThreadPool instead with Task etc and the slowness went away.
choosing "Load only specified modules" did the trick (Tools=>Options=>Debugging=>Symbols)
In my case I had a break point with a condition that was never met. I had forgotten about about this break point altogether. Sometimes adding a simple condition to a break point can slow down the debugging speed a lot.
Just adding this in case it might help someone.
workaround that I used was to run msvcmon.exe locally with admin mode before starting the debugger. Then start the attach window and providing the remote debugging port.

Visual Studio Debugging is stuck at "Attaching to the web server"

When I run my Web API application I get the following window:
It just stays like that indefinantly, until I hit cancel.
When I do hit cancel, this error message is shown:
I have tried rebooting, and running iisreset /restart but it does not fix it.
Any ideas what I can do to get my debugger working again?
NOTE: My Web API 2 project's Servers setting is set to Local IIS. My service is hosted by IIS and when I am not debugging, it works fine.
A possible fix:
Check the "Enable Just My Code" in Tools->Options->Debug
I just did a reset for all the settings for VS and it worked again.
Tools => Import and Export Settings => Reset All Settings
good luck!
I had this issue for Visual Studio 2017 and like with the previous post I had Debugging option "Enable .NET Framework source stepping" ticked. Un-ticking fixed the issue.
So as I commented before I had this same issue, but I now figured out the cause and have a solution.
I just got a new machine last week (this issue was actually one of the reasons why) and after a while I had the same issues, not being able to debug my projects. Luckily because I was installing all the updates one by one I was able to pin-point when it started happening.
It seems the latest update for the "Microsoft ASP.NET and Web Tools" extension breaks something.
Sadly, uninstalling or reverting the Web Tools extension is not easy: Remove this extension by going to the Windows control panel and modifying your Visual Studio installation. I had to remove Visual Studio completely and reinstall it (repair didn't do the trick).
You can update and install all your extensions as you wish, just make sure that you don't update the Web Tools extension
I tested this on my old machine and it did the trick there as well.
I've also created an Issue on GitHub as I won't be updating the extension until this is fixed, if anybody has additional information please add it to the Issue.
In Visual Studio 2015, go to Tools -> Options -> Debugging and deselect "Enable .NET Framework source stepping". This may relate to an issue with loading symbols, so if you want to keep the ability to debug .NET Framework source, then it may help to search the web for how to clear the symbol cache, or preload it, or set your symbol server, and so on.
In Visual Studio 2017, I just restarted my machine and ran the solution, no other windows opened not even a browser, although visual studio took a long time to open (30+ projects in a solution) the problem did not reoccur.
I had the same issue in VS 2017 and un-checking 'Native code' did the trick. Not sure why it was checked.
In my case I set Debugging ->Symbols -> To "Load Only Specified Modules" to include the symbols for, in my case a devops symbols feed for some internal NuGet packages
Options>Debugging>Symbols>Load Only Specified Modules
By checking the option "Always load symbols where located next to modules" the setting won't mess with the regular/classic debugging in VS for your own code
This way the Symbols are still loading where needed and Visual Studio is not trying to load debugging information for all the IIS .net dlls that were loaded by w3wp
Alternatively it can also be configured to not load symbols for microsoft.*.dll and it will also work.
Didn't see this in the current answers, so thought I'd give my 2 cents in 2022:
What worked for me:
Make sure to check that your IIS application pool hasn't been stopped (and restart it if it is), and then if that's not the case, restart your IIS server.
If you don't where those settings are, open our Internet Information Services (IIS) Manager, Application Pools are in the left-hand column, and restart/start/stop your server is in the right column.

Slow performance in Visual Studio 2012 update 4 RC when setting a breakpoint

I'm using Visual Studio 2012 update 4 RC.
When I set a breakpoint in my MVC 4 app (C#), the performance goes drastically down. From << 1sec. to 40-60 seconds for a page refresh (if the page appears at all.....)
Disabling all breakpoints bring the performance to a normal level.
How can I set breakpoint without a major performance penalty?
You may try to delete your .suo file but beware as you may loose your personal solution configuration settings for this solution.
You may also try disabling "Enable property evaluation and other implicit function calls" in Tools > Options > Debugging > General.
Also check this related question:- Visual Studio Debugging/Loading Very Slow
To solve this issue I've quit using the Azure Full Emulator and started using the Emulator Express.
rightclick the azure project
select properties
web emulator -> select 'Use Emulator Express'

Why is Visual Studio 2013 very slow?

I'm running Visual Studio 2013 Pro (RTM version) on my formatted PC (Windows 8.1 fresh install).
I don't know why, but Visual Studio 2013 Pro is very very slow! Slow for building, debugging, navigating in the IDE... my hard disk drive LED is not lighting up at all!
I'm on a little MFC (C++) project using the Boost library.
Any ideas?
It is something concerned with the graphics drivers. If you update them you will be fine.
Or you can disable the hardware graphics acceleration in Visual Studio according to these steps:
In Visual Studio, click "Tools", and then click "Options".
In the Options dialog box, navigate to the "Environment > General" section and clear the "Automatically adjust visual experience based on client performance" check box. (Refer to the following screen shot for this step.)
Clear the "Use hardware graphics acceleration if available" check box to prevent the use of hardware graphics acceleration.
Select or clear the "Enable rich client visual experience" check box to make sure that rich visuals are always on or off, respectively. When this check box is selected, rich visuals are used independent of the computer environment. For example, rich visuals are used when you run Visual Studio locally on a rich client and over remote desktop.
References:
You experience performance issues, product crashes, or rendering issues in Visual Studio 2013
Try to set Current source control plug-in to None (menu Tools → Options → Source Control), if you are using the Microsoft Git provider, which seems to slow Visual Studio 2013 down more and more the larger the repository gets.
I had the whole Dojo Toolkit framework under source control using the Microsoft Git provider, and it got to the point where there were delays from the time I hit a key to the time the glyph would appear on the screen. That bad.
When/if you need Git again, you can switch to the TortoiseGit provider or Git-Extensions, both will work without slowdown. I like Git-Extensions, personally.
I too have struggled a bit with bad performance in Visual Studio 2013 (Premium). Pretty much the same issues as TS had. Slow navigation, scrolling, building... just about everything. Luckily I have manage to solve my own problem by disabling Synchronized Settings in Visual Studio.
Go to menu Tools → Options → Environment-Synchronized Settings and remove this option by unchecking the checkbox.
In the case of web applications, another cause of slow building and debugging (but not IDE navigation) could be the Browser Link feature.
I found that with this switched on, building would take 4 times longer and debugging was painful - after every postback, web pages would freeze for a few seconds before you could interact with them.
I was using a solution upgraded from Visual Studio 2012. Visual Studio 2013 also upgraded the .suo file. Deleting the solution's .suo file (it's next to the .sln file), closing and re-opening Visual Studio fixed the problem for me. My .suo file went from 91KB to 27KB.
I had the same problem and the only solution that worked for me was to follow the three steps presented below:
Clean the WebSiteCache folder (you may find it at
C:\Users\%USERNAME%\AppData\Local\Microsoft\WebSiteCache)
Clean the "Temporary ASP.NET Files" folder (find it at
C:\Users\%USERNAME%\AppData\Local\Temp\Temporary ASP.NET Files)
Restart Visual Studio
What fixed it for me was disabling Git by setting Current source control plug-in to None in Visual Studio, menu Options → Source Control:
This issue seems to be because of uninstalling the SQL Server Compact edition (4.0).
I was having this issue, and it got fixed after installing the SQL Server Compact edition 4.0.
On closing Visual Studio 2013, I was getting a message to install SQL Server Compact edition as a C++ project needed some thing... can't put finger on anything.
Resolve this issue by installing Microsoft SQL Server Compact 4.0
Microsoft SQL Server Compact 4.0
I can advise an option like this.
CodeLens can be disabled like as at the picture. It gives a lot of performance goodness.
If you are debugging an ASP.NET website using Internet Explorer 10 (and later), make sure to turn off your Internet Explorer 'LastPass' password manager plugin. LastPass will bring your debugging sessions to a crawl and significantly reduce your capacity for patience!
I submitted a support ticket to Lastpass about this and they acknowledged the issue without any intention to fix it, merely saying: "LastPass is not compatible with Visual Studio 2013".
I had the same problem and all the solutions mentioned here didn't work out for me.
After uninstalling the "Productivity Power Tools 2013" extension, the performance was back to normal.
One more thing to check; for me it was Fusion logging.
I'd turned this on a very long time ago and more or less forgotten about it. Getting rid of the 5000+ directories and 1 GB of logged files worked wonders.
There is a good workaround for this solution if you are experiencing slowness in rendering the .cs files and .cshtml files.
Just close all the files opened so that the cache gets cleared and open the required files again.
Visual Studio Community Edition was slow switching between files or opening new files. Everything else (for example, menu items) was otherwise normal.
I tried all the suggestions in the previous answers first and none worked. I then noticed it was occurring only on an ASP.NET MVC 4 Web Application, so I added a new ASP.NET MVC 4 Web Application, and this was fast.
After much trial and error, I discovered the difference was packages.config - If I put the Microsoft references at the top of the file this made everything snappy again.
Move the Microsoft* entries to the top.
It appears you don’t need to move them all - moving say <package id="Microsoft.Web.Infrastructure" has an noticeable effect on my machine.
As an aside
Removing all contents of the file makes it another notch faster too*
Excluding packages.config from Visual Studio does not fix the issue
A friend using Visual Studio 2013 Premium noticed no difference in either of these cases (both were fast)
UPDATE
It appears missing or incomplete NuGet packages locally are the cause. I opened the Package manager and got a warning 'Some NuGet packages are missing from this solution' and choose to Restore them and this sped things up. However I don’t like this as in my repository I only add the actual items required for compilation as I don’t want to bloat my repository, so in the end I just removed the packages.config.
This solution may not suit your needs as I prefer to use NuGet to fetch the packages, not handle updates to packages, so this will break this if you use it for that purpose.
For me, the problem was the Start page -- it was downloading content and causing Visual Studio to hang.
The only solution for me was to:
Kill the DevEnv process from Task Manager
Start Visual Studio in Safe Mode from the command line:devenv.exe /safemode
Go to menu Tools → Options, and select the Environment/Startup options
Choose "Show empty environment" for the startup action
Close Visual Studio
Restart normally
Running unit tests was slow. It was a ReSharper issue.
Menu ReSharper → Options → Environment → General ... Clear Caches
Menu Tools → Options → ReSharper → General ... Suspend Now
Close Visual Studio
Delete the .suo file.
Open Visual Studio again.
Re-enable ReSharper.
I also had an issue with a slow IDE.
In my case I installed
ReSharper
Npgsql (low chance to cause the problem)
Entity Framework Power Tools Beta 4
The following helped me a bit:
Disabled synchronization - menu Tools → Options → Environment-Synchronized Settings
Disabled plug-in selection - menu Tools → Studio → Options → Source Control.
Disabled Entity Framework Power Tools Beta 4 - menu Tools → Extensions and Updates
Uninstalled JetBrain's Resharper - WOW!! I am fast again!!
Change the Fusion Log Value to 0. It solved my issue.
This is the FusionLog key in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
Check ForceLog value (1 enabled, 0 disabled).
I was also facing this issue for quite long time. Below are the steps that I perform, and it works for me always:
Deleting the solution's .suo file.
Deleting the Temporary ASP.NET Files (You can find it at find it at %WINDOW%\Microsoft.NET\Framework\Temporary ASP.NET Files)
Deleting all breakpoints in the application.
Visual Studio 2013 has a package server running, and it was spending up to 2 million K of memory.
I put it to low priority and affinity with only one CPU, and Visual Studio ran much more smoothly.
Performance Explorer
Have you been using menu Analyze → Performance and Diagnostics? I have! It's awesome! But you may want to clean up.
Open the Performance Explorer. If you collapse all of the items in there, select all, then you can right click and do Delete.
My solution opens faster and is in general running much faster now.
Also you may notice changes to your sln file as shown. For me, this section was deleted from the sln.
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
In Visual Studio 2015 Community edition, I've experienced a very (very) slow IDE after changing the "Environment Font" on menu Tools → Options... → Fonts and Colors.
Reverting this options back to the default value ("automatic") solved it immediately.
I had similar problems when moving from Visual Studio 2012 → Visual Studio 2013. The IDE would lock up after almost every click or save, and building would take several times longer. None of the solutions listed here helped.
What finally did help was moving my projects to a local drive. Visual Studio 2012 had no problems storing my projects on a network share, but Visual Studio 2013 for some reason couldn't handle it.
I had a Visual Studio 2013 installed, and it was running smoothly. At some point it started to get sluggish and decided to install Visual Studio 2015. After install, nothing changed and both versions were building the solution very slow (around 10 minutes for 18 projects in solution).
Then I have started thinking of recently installed extensions - the most recent installed was PHP tools for Visual Studio (had it on Visual Studio 2013 only). I am not sure how can an extension affect other versions of Visual Studio, but uninstalling it helped me to solve the problem.
I hope this will help others to realize that it is not always Visual Studio's fault.
I added "devenv.exe" as an exclusion to Windows Defender. This solved my problem completely. People can try this as their first try.
I have the same problem, but it just gets slow when trying to stop debugging in Visual Studio 2013, and I try this:
Close Visual Studio, then
Find the work project folder
Delete .suo file
Delete /obj folder
Open Visual Studio
Rebuild
None of the suggestions worked for me, but I did solve my problem. I had tried most of the other recommendations before coming to the following solution.
My Scenario/Problem:
Using Visual Studio 2017 with ReSharper Ultimate. Keyboard input in the IDE got super slow as others have described. The last change I made to my solution was to add a new web site project, so I looked into that. After trying a lot of things, I tried adding a second web site project, so I could try to replace the first one, and Visual Studio just tanked after that. It wouldn't even load the solution anymore.
My Solution:
I forced Visual Studio closed and then I removed the newly added web site project(s) from the .sln file using Notepad. After saving and starting Visual Studio, my solution loaded quickly and everything seemed to be back to normal. I added a new Web Site with a slightly different configuration (see the thinking below), and the problem did not present itself again.
My Thinking:
I think the problem stemmed from creating the new web site project and using a file system path to a network share that is hosted in Azure. I'm working over VPN which tends to slow things down, and I occasionally experience various routing problems with some services, so my problem/solution might be a bit of a snowflake. I changed the file system path to be a local repository and will publish the files as needed which seems like a much better way to go.
I had a Visual Studio behavior where the typing was slow for my HTML files. Previously when I installed, I guessed that because my HTML files were generic HTML that the need to install any web development tools from the workload component of the installer was unnecessary. I went back and installed this bit and Visual Studio behavior became as I expected it.
This already has a bunch of answers here, but a general way to easily boost Visual Studio is to clear your temp files.
Press the Windows Key and R, and enter 'temp'. Press enter, and provide any administrator permission if you need to. Then press Control A to select all, and hit the Del key. Remember to provide any administrator permissions, and if 'the item is already in use' then just press skip.
After this, Press Windows Key and R again, but this time type '%temp%'. Repeat the previous steps in the new directory.
Finally, empty the recycle bin.
This might not help a ton, but it should boost general performance.

How to improve Visual Studio 2008 Website Compilation Perfomance

I am having severe performance issues when compiling a moderately large ASP.Net website in Visual Studio 2008 (targeting .Net 3.5). I know there are some tips & registry hacks for improving compilation performance in VS 2005, are there any for VS 2008? Specifically, it seems that VS 2008 is compiling the whole website every time F5 is hit, even when no files have changed in that project since the last compile, or perhaps there is some way to skip the validation stage?
Antivirus problems: Make sure that your Antivirus program excludes your project directories! Make sure that your Microsoft.NET directory inside of your Windows directory is also on the exclusion list.
IIS vs. "Cassini" : If you can, use IIS instead of VS's integrated web server (aka "Cassini"). Doing this will prevent the server from having to restart every time you run.
Memory: Do you have enough?
I'm guessing this is an ASP.Net Website project and not an ASP.Net Web Application project. You'll get better compile performance from a Web Application project so you might consider converting it.
For a Website project, you can open the Website in Visual Studio, right click the web site project node in the Solution Explorer and click Properties. When the dialog box opens, click the Build item and set the item labeled "Before Running Startup Page" to "No Build" or "Build Page". This will prevent Visual Studio from compiling all the pages in your site and improve your local development experience at the cost of reduced compilation. Probably a worthy trade-off in your case.
If you have a lot of stuff in App_Code, you may want to move (some of) it to a seperate assembly.
Try renaming your .suo file
Watch out for Dueling Assemblies (where was this article when I was having the problem =) ?), one bad reference was killing me before. I noticed this and other potential problems by looking at the output window during the build process.
.Net 3.5 Service Pack 1 made some big performance gains at least in terms of the IDE and switching from Code to Design view. I don't know if it affects the general compilation speed, but it is worth applying if you've not yet.

Resources