<p>I get the following error pretty regularly when compiling in Visual Studio and running my web application:</p>

<p>"Unable to start debugging on the web server. The web server did not respond in a timely manner.  This may be because another debugger is already attached to the web server."</p>

<p>Normally this is after having debug the application once already. From the command line I run "iisreset /restart" and it fixes the problem.</p>

<p>How do I prevent this from happening in the first place?</p>

[{'answer_id': 2544, 'author': 'palehorse', 'author_id': 312, 'author_profile': 'https://Stackoverflow.com/users/312', 'pm_score': 2, 'selected': False, 'text': '<p>It sounds like you are probably hitting F5 in Visual Studio when you receive this error?</p>\n\n<p>There are a few things you can try.  The easiest is to hit the <strong>Stop</strong> button before hitting F5.  Optionally, when you are finished debugging and starting to make changes you can go to the <strong>Debug</strong> menu and choose either <strong>Stop Debugging</strong> or <strong>Terminate All</strong>.</p>\n'}, {'answer_id': 2545, 'author': 'Brad Tutterow', 'author_id': 308, 'author_profile': 'https://Stackoverflow.com/users/308', 'pm_score': 0, 'selected': False, 'text': '<p>It sounds like something is eating up your web server\'s resources.  Perhaps you have some resources (file handlers, wcf proxies) that are being opened and not closed? I\'ve had this happen to me specifically when I was not closing WCF client proxy connections.</p>\n\n<p>The problem is not necessarily that you have a debugger attached, but only that the web server is not responding in a timely manner.  Note that the message says "This <strong>may</strong> be because another debugger is attached".</p>\n'}, {'answer_id': 18046, 'author': 'Gabriël', 'author_id': 2104, 'author_profile': 'https://Stackoverflow.com/users/2104', 'pm_score': 2, 'selected': False, 'text': '<p>We use another way of debugging, we never use F5 anymore. </p>\n\n<p>We use a macro kind of like: <a href="http://blogs.conchango.com/howardvanrooijen/archive/2007/06/24/Attach-to-Web-Server-Macro-for-Visual-Studio.aspx" rel="nofollow noreferrer">http://blogs.conchango.com/howardvanrooijen/archive/2007/06/24/Attach-to-Web-Server-Macro-for-Visual-Studio.aspx</a> (Which we bound to F6).</p>\n\n<p>This way you simply attach the debugger to IIS. It\'s (depending on project size) much quicker to make you changes, compile a single project that you changed and attach the debugger again.</p>\n'}, {'answer_id': 151931, 'author': 'Guy', 'author_id': 1463, 'author_profile': 'https://Stackoverflow.com/users/1463', 'pm_score': 6, 'selected': True, 'text': "<p>I find that this happens if I'm debugging with Firefox as my browser. When I exit Firefox the VS2005/8 debug session doesn't terminate. I have not found a solution for this (yet).</p>\n\n<p>If this is what's happening with you then a quicker solution than running iisreset is to hit Shift-F5 when in Visual Studio and this will terminate the current debug session. You can then hit F5 and this will start a new debug session.</p>\n"}, {'answer_id': 856572, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>If you have a lot of break points this will slow the debugging process down, so remove unneeded break points  and close the Autos window  this will solve your problem</p>\n'}, {'answer_id': 1244167, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>The issue is normally there when an another instance of iexplore is still running. I used to have the issue when my IE crashes but I can still see it in the Task Manager. Once you "End Process" everything is back to normal :)</p>\n'}, {'answer_id': 3065575, 'author': 'Skylar Hayes', 'author_id': 369785, 'author_profile': 'https://Stackoverflow.com/users/369785', 'pm_score': 0, 'selected': False, 'text': '<p>This answer will only apply if you are running your solution through IIS. You will know if this applies to you IF you open up your website/project by doing the following:\nFrom within visual studio--&gt;Open Website--&gt; Local IIS --&gt;Select your project</p>\n<p>This error Kicked my butt for 4 hours but finally I found an answer. I first attempted the iisreset /restart. This seemed to slightly help but still received the same error.</p>\n<p>What worked for me was going (xp machine) to add/remove programs --&gt; Add/Remove Windows Components--&gt; Click on IIS--&gt; Click on &quot;Details&quot;. Be sure to have Front Page Extensions installed if you are debugging through IIS.</p>\n'}, {'answer_id': 4828140, 'author': 'developer', 'author_id': 593804, 'author_profile': 'https://Stackoverflow.com/users/593804', 'pm_score': 2, 'selected': False, 'text': '<p>Go to task manager and end process aspnet_wp.exe before running application</p>\n'}, {'answer_id': 7360984, 'author': 'aeciftci', 'author_id': 743793, 'author_profile': 'https://Stackoverflow.com/users/743793', 'pm_score': 0, 'selected': False, 'text': '<p>If all the answers does not work for you, just end process all IIS related components in task manager. This is what worked for me.</p>\n'}, {'answer_id': 12119308, 'author': 'Mandeep Janjua', 'author_id': 895724, 'author_profile': 'https://Stackoverflow.com/users/895724', 'pm_score': 1, 'selected': False, 'text': '<p>I saw this message first time in my life and I was very confused about what is going on as it is not pretty obvious what to do. </p>\n\n<p>I ran <strong>iisreset</strong> and it took just 1 sec to finish the execution, and boom, I was back into the game.</p>\n\n<p>P.S. I am using chrome</p>\n'}, {'answer_id': 12730164, 'author': 'atconway', 'author_id': 410937, 'author_profile': 'https://Stackoverflow.com/users/410937', 'pm_score': 0, 'selected': False, 'text': '<p>I ran into this issue when trying to debug (2) separate solutions in VS.NET and <em>both</em> were using the IIS Web Server to launch the app. The 1st application will start, but any subsequent applications started that also run via IIS will then display that error. It seems that it can only debug a single application via VS.NET hosted in IIS at a time.</p>\n\n<p>The solution: run project 1 from VS.NET (place any needed breakpoints) and start the <em>second</em> application directly from IIS (not VS.NET). Your breakpoints in App 1 (running in VS.NET) will be hit when accessing App 2 (ran from IIS directly).</p>\n'}, {'answer_id': 14263688, 'author': 'TeckniX', 'author_id': 99000, 'author_profile': 'https://Stackoverflow.com/users/99000', 'pm_score': 0, 'selected': False, 'text': "<p>This happens to me quite a bit in VS 2010 express - Usually because the debugger stopped responding.\nRight click windows taskbar, select 'Start Task Manager'. More than likely the ASP.NET debugger will be showing a 'not responding' status. Select it and simply terminate the process.</p>\n\n<p>Done!</p>\n"}, {'answer_id': 15468241, 'author': 'Sergey Glukhov', 'author_id': 2180661, 'author_profile': 'https://Stackoverflow.com/users/2180661', 'pm_score': 0, 'selected': False, 'text': '<p>With me it happened when IE was upgraded to newer version, went to Installed Updates, removed new version of IE, after computer restarted it went back to old version and problem with debugging was solved</p>\n'}, {'answer_id': 15617688, 'author': 'Ike', 'author_id': 1238259, 'author_profile': 'https://Stackoverflow.com/users/1238259', 'pm_score': -1, 'selected': False, 'text': '<p>I just solved this problem on my machine.\nMy problem is that I upgraded IE 9 To IE 10 and I got this error.\nSolution : Remove IE 10 and downgrade to IE 9.\nGo to "Programs and Features" --> "View recent updates" --> find IE 10---> Uninstall it-->reboot--->ie 9 is back--->debug--->works OK.</p>\n'}, {'answer_id': 19221974, 'author': 'Murugan', 'author_id': 1703511, 'author_profile': 'https://Stackoverflow.com/users/1703511', 'pm_score': 1, 'selected': False, 'text': '<p>Hit Shift+F5 when in Visual Studio and this will terminate the current debug session. You can then hit F5 and this will start a new debug session.</p>\n\n<p>or</p>\n\n<p>close your application, reset iis then open your application and run it</p>\n'}, {'answer_id': 20569458, 'author': 'patricgh', 'author_id': 1328912, 'author_profile': 'https://Stackoverflow.com/users/1328912', 'pm_score': 1, 'selected': False, 'text': '<p>For me I had two visual studio open. The debugger already was attached to another visual studio :). I stopped it on the first one and was able to attach on the second visual studio. </p>\n'}, {'answer_id': 21979225, 'author': 'Caio Campos', 'author_id': 1846266, 'author_profile': 'https://Stackoverflow.com/users/1846266', 'pm_score': 3, 'selected': False, 'text': '<p>After trying all of the proposed solutions here and in other places (at least 10 different approaches), the only option that worked for me was:</p>\n\n<ul>\n<li>delete website and application pool on IIS</li>\n<li>re-create website and application pool on IIS (in my case, everything exactly the same config as before)</li>\n</ul>\n\n<p>PS: I am using VS 2013 and IIS 7.5 (Win7).</p>\n\n<p>I hope this saves someone else a few hours.</p>\n'}, {'answer_id': 24647594, 'author': 'Ramasamy', 'author_id': 3819299, 'author_profile': 'https://Stackoverflow.com/users/3819299', 'pm_score': -1, 'selected': False, 'text': '<p>Try performing either of the following steps to resolve your issue:</p>\n\n<ul>\n<li>Restart your IIS Server</li>\n<li>Clean the Solution of your project then build again</li>\n</ul>\n\n<p>If above steps do not help, you can finally try restarting your machine </p>\n'}, {'answer_id': 27973753, 'author': 'Alberto Montellano', 'author_id': 2848629, 'author_profile': 'https://Stackoverflow.com/users/2848629', 'pm_score': 5, 'selected': False, 'text': '<p>The solution that worked for me:</p>\n\n<ol>\n<li><p>Open Command Prompt (Run as Administrator)</p></li>\n<li><p>Write <code>iisreset /restart</code></p></li>\n<li><p>Now, go back to your VS and debug. It will debug your solution.</p></li>\n</ol>\n\n<p>It worked for Visual Studio 2013 and 2015 too in my case.</p>\n'}, {'answer_id': 29280115, 'author': 'miniscem', 'author_id': 3353526, 'author_profile': 'https://Stackoverflow.com/users/3353526', 'pm_score': 2, 'selected': False, 'text': "<p>I have had this problem a couple times. One time it was resolved by taking Guy's advice:</p>\n<blockquote>\n<p>If this is what's happening with you then a quicker solution than running iisreset is to hit Shift-F5 when in Visual Studio and this will terminate the current debug session. You can then hit F5 and this will start a new debug session.</p>\n</blockquote>\n<p>On a separate occasion I had to: terminate all my IIS worker processes in the windows task manager (w3wp.exe*). You should be able to hit f5 in visual studio to debug.</p>\n"}, {'answer_id': 29394530, 'author': 'Graham Laight', 'author_id': 1649135, 'author_profile': 'https://Stackoverflow.com/users/1649135', 'pm_score': 1, 'selected': False, 'text': '<p>Very basic - but check that if you try to run the web site from IIS by clicking on "Browse", the site actually runs.</p>\n'}, {'answer_id': 32272826, 'author': 'John', 'author_id': 3364587, 'author_profile': 'https://Stackoverflow.com/users/3364587', 'pm_score': 0, 'selected': False, 'text': '<p>Had the same problem, even after a reboot.  Basically did this:</p>\n\n<ol>\n<li>Restart IIS</li>\n<li>Clean Solution</li>\n<li>Rebuild Solution</li>\n</ol>\n\n<p>Then it started working again.</p>\n'}, {'answer_id': 34310844, 'author': 'Reg Edit', 'author_id': 1657610, 'author_profile': 'https://Stackoverflow.com/users/1657610', 'pm_score': 0, 'selected': False, 'text': '<p>This can also be caused if your website uses a database connection but the database server is unavailable.</p>\n\n<p>I spent some time trying to resolve this issue in the usual ways, but even after restarting my workstation, the issue remained. Eventually I found that the SQL Server (MSSQLSERVER) service was not running. </p>\n\n<p>It should have been running, as it\'s set to Automatic, but it was stopped, even after the reboot. All the MSSQLSERVER events in the event log appeared normal, so it remains unknown why it wasn\'t running, but I have now set it to Automatic (delayed start) in the hope that this will reduce resource contention during startup.</p>\n\n<p>Once I started MSSQLSERVER , the message <code>"Unable to start debugging on the web server. The web server did not respond in a timely manner"</code> no longer appeared and normal service was resumed.</p>\n'}, {'answer_id': 35238388, 'author': 'DKR', 'author_id': 4953903, 'author_profile': 'https://Stackoverflow.com/users/4953903', 'pm_score': -1, 'selected': False, 'text': '<p>In your cmd type iisreset and press enter after that your iis is reset and your application is working perfectly</p>\n'}, {'answer_id': 38392525, 'author': 'Atif Ali Bhatti', 'author_id': 1694680, 'author_profile': 'https://Stackoverflow.com/users/1694680', 'pm_score': 0, 'selected': False, 'text': '<p>I had to recreate the site/application/virtual directory to make it work after I installed vs2015 update3. Hope this helps someone. ;)</p>\n'}, {'answer_id': 39255659, 'author': 'MarkoCen', 'author_id': 5454390, 'author_profile': 'https://Stackoverflow.com/users/5454390', 'pm_score': 0, 'selected': False, 'text': '<p>I know this is an old question, but I met the same situation recently and try every solution in this post, and no luck. Finally, I found the solution that works for me:</p>\n\n<ol>\n<li>Close Visual Studio</li>\n<li>Find <strong>Turn Windows features on or off</strong> in <strong>Control Panel</strong></li>\n<li>Uncheck <strong>Internet Information Services</strong> in the popup dialog</li>\n<li>Restart your computer</li>\n<li>Check <strong>Internet Information Services</strong> in the same dialog, and make sure <strong>Internet Information Service</strong> -> <strong>World Wide Web Services</strong> -> <strong>Application Development Features</strong> -> <strong>ASP.NET</strong> also been checked</li>\n<li>Open Visual Studio, and now your application should be able to run in debug mode</li>\n</ol>\n'}, {'answer_id': 39329843, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Open</p>\n\n<ul>\n<li>Options and Settings Under the debug </li>\n<li>Symbols and unchecked Microsoft Symbol Servers</li>\n<li>build solution</li>\n<li>iisreset</li>\n<li>F5 solution\n(Be sure Microsoft Symbol Servers unchecked again)</li>\n</ul>\n'}, {'answer_id': 40021759, 'author': 'Edward', 'author_id': 7013830, 'author_profile': 'https://Stackoverflow.com/users/7013830', 'pm_score': 2, 'selected': False, 'text': '<p>When debugging 2 web application (1 MVC and 2 is MVC WebAPI) that are both hosted in the local IIS.\nMake sure that each application is using a different application pool.\nI encountered the same issue and as soon as I change the app pool of the other one, it worked!</p>\n'}, {'answer_id': 43239550, 'author': 'Sandeep', 'author_id': 1604050, 'author_profile': 'https://Stackoverflow.com/users/1604050', 'pm_score': 0, 'selected': False, 'text': '<p>This worked for me by @mtkachenko\n<a href="https://stackoverflow.com/questions/24605673/visual-studio-2012-unable-to-attach-the-process-a-debugger-is-already-attached">Visual Studio 2012: Unable to attach the process. A debugger is already attached</a>\n"I have installed Debug Diagnostic Tool v2.0 and as a result I have Debug Diagnostic Service which is started automatically and attached to one of w3wp processes. After turning off and disabling this service all works fine. So if you get such error check processes in task manager which can capture your w3wp process"</p>\n'}, {'answer_id': 56541364, 'author': 'Angel Quero', 'author_id': 11630385, 'author_profile': 'https://Stackoverflow.com/users/11630385', 'pm_score': -1, 'selected': False, 'text': '<p>In my case it gets solve deleting all breakpoints. Looks like I had a lot of breakpoints(conditional and not conditional) and it was causing lack of resources .</p>\n'}, {'answer_id': 67121798, 'author': 'Vamsi J', 'author_id': 4365121, 'author_profile': 'https://Stackoverflow.com/users/4365121', 'pm_score': 0, 'selected': False, 'text': '<p>I got it worked by creating a new ApplicationPool in the IIS Server and pointing my application to the new ApplicationPool. I have also deleted the old ApplicationPool</p>\n'}]
['https://Stackoverflow.com/questions/2524', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/417/']