Visual Studio 2008 crashes on third time - asp.net

I have this strange problem which I can't seem to fix.
I have made an ASP.Net application in Visual Studio 2008. When ever I try to debug the third time, VS gives that error i.e. send report to Microsoft. Now I had to close VS and start again to debug. Then again I am able to debug two times and then again error after which I have to close VS and start again.
Here's some clarification if you still don't understand.
Run F5 to debug application. Web server starts. Browser opens and my site opens in it.
Stop debugger
Run F5 to debug again and everything goes fine as usual
Stop debugger
Now if I press F5 the third time, it gives error.
Any idea how to fix this issue?

Try closing all instances of the browser before debugging again. I've done this to resolve this type of error before (using Firefox). It seemed to be a browser issue.

Now I started visual studio from command prompt as below and it doesn't crash.
devenv.exe /log

Related

IISExpress not connecting when trying to debug

I'm working a ASP.NET MVC project in Visual Studio 2015 (14.0.25431.01 Update 3) that runs IISExpress to debug the application. However, sometimes (and I haven't figure out what the trigger is) when I debug the application my browser will open to the correct URL but it will just say "Unable to connect".
If I try to refresh the window nothing changes. If I check Visual Studio it still says it's debugging so the debugger or IIS doesn't seem to have crashed. Sometimes if I just click Restart it will work fine. However, sometimes this error continues and I have to kill the IIS process. I've tried deleting the files under .vs\config but that didn't help.
Is there any way to fix this or anyway to find some logs to see whats happening? This started in the last few weeks and it starting to drive me crazy.
Edit
Happened again and tried connecting via Chrome as well as my usual FireFox. Looking at the developer tools in Chrome I'm seeing the ERR_CONNECTION_REFUSED message.
I decided to check the Windows Event Viewer and found that it looks like IIS Express can't bind to the port.The error message is:
Unable to bind to the underlying transport for [::]:12345. The IP Listen-Only list may contain a reference to an interface which may not exist on this machine. The data field contains the error number.
But why it can't bind to that port I don't understand.

"Thread was being aborted" error when debugging a ASPNET WebAPI project

I started getting this error recently when debugging a WEBAPI project (C#) in VS 2012 (update 2) on my dev machine.
The app is hosted in IIS Express running locally on my dev box.
"Thread was being aborted".
The weird thing is that this error happens only when debugging. It works fine when the debugger is detached. It also seem to happen at random locations in the
code file where I have breakoints set. Once the break point hits, I am able to step through upto a certain point and then the error occurs.
I have tried to explicity catch the error and here is what I get when I try to expand the exception details.
"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack". All the exception properties have the same error
message.
NOTE: I have no Response.Redirects as many have pointed out could be the root cause.
Recently I had the following items installed on this box:
1)NodeJS
2)NodeJS Tools for Visual Studio
3)Web Essentials Tools
4)Doubled the RAM on my box from 8 to 16GB (max).
I have undone the above but not sure if any of those could be the root cause. Since unintalling I have also "Repaired" Visual Studio and also deleted my user profile
and recreated it to no vain.
I am attached to a windows domain. Not sure if this is a Visual Studio anomaly or whether my installation is genuinely screwed up.
Any help/insights appreciated.

Start debugging versus View in browser

What is different between Start debugging and View in browser
I just know that view in browser in faster than Start Debugger but i don't know why.
View in browser launches the process of the browser and navigates to your page.
Debug is used when you want to step through your code. Apart from what "view in browser" does, it also attaches the visual studio debugger to the process running asp.net so that they can communicate with each other. It is slower, because visual studio starts tracking the execution of your server code (would it need to hit a breakpoint somewhere).
You can read more on debugging with Visual Studio on MSDN.

can't debug asp.net - "unable to start program"

I cannot debug an asp.net application. Nothing was changed or installed on purpose, maybe some automatic updates, which I thought were turned off. Just woke up one day and whenver I try to debug, I get the mesage "Unable to start program http://localhost:49404/Default.aspx". This is Visual Studio 2008 on Vista Business 64 bit. Facts:
-neither applications that use IIS or the built in webserver will debug
-applications will run without debugging (debug build, just run)
-visual studio, iis, and the dot net 3.5 sdk have been reisntalled.
Any ideas? This is going on days trying to figure this out. About to reisntall vista.
Brian
Did the addressing change? Is the site still on port:49404?
Have you any antivirus running on your vista box? Which one?
When you start debugging, a little cloud appears on the bottom right side of your screen, it indicates the port cassini's server is running on. Is this port the same as 49404?
Here are some pointers and tips:
check the output of this program \Windows\Microsoft.NET\Framework\v2.0.XXXX\WebDev.WebServer.exe
Did your default project change?
Is your default browser working correctly?
Before you reinstall OS you may want to
reinstall ASP.Net (aspnet_regiis.exe)
reinstall your default browser
Crazy, but may solve the problem. Try this:
Start without debug (ctrl+F5), and when IE opens, start again in debug mode (F5).
Dont exit from IE, just stop debug in VS2008.
I had this exact problem with Visual Studio 2008. The solution was to set the default web browser that VS uses to a real browser (e.g. IE) and not the "Internal Web Browser".
Right click on an ASPX file in your project and select "Browser With...". This lets you select the default browser to use when you select the "View in Browser" option and for when you debug/run the app (this is key).
Select your favourite browser (i.e "Internet Explorer") and click on "Set as Default". Do not pick "Internal Web Browser".
Debug away! Your app should come up in your browser now and debug as normal.

Visual Studio "Unable to start debugging on the web server. The web server did not respond in a timely manner."

I get the following error pretty regularly when compiling in Visual Studio and running my web application:
"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."
Normally this is after having debug the application once already. From the command line I run "iisreset /restart" and it fixes the problem.
How do I prevent this from happening in the first place?
The solution that worked for me:
Open Command Prompt (Run as Administrator)
Write iisreset /restart
Now, go back to your VS and debug. It will debug your solution.
It worked for Visual Studio 2013 and 2015 too in my case.
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).
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.
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:
delete website and application pool on IIS
re-create website and application pool on IIS (in my case, everything exactly the same config as before)
PS: I am using VS 2013 and IIS 7.5 (Win7).
I hope this saves someone else a few hours.
Go to task manager and end process aspnet_wp.exe before running application
I have had this problem a couple times. One time it was resolved by taking Guy's advice:
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.
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.
It sounds like you are probably hitting F5 in Visual Studio when you receive this error?
There are a few things you can try. The easiest is to hit the Stop button before hitting F5. Optionally, when you are finished debugging and starting to make changes you can go to the Debug menu and choose either Stop Debugging or Terminate All.
We use another way of debugging, we never use F5 anymore.
We use a macro kind of like: http://blogs.conchango.com/howardvanrooijen/archive/2007/06/24/Attach-to-Web-Server-Macro-for-Visual-Studio.aspx (Which we bound to F6).
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.
When debugging 2 web application (1 MVC and 2 is MVC WebAPI) that are both hosted in the local IIS.
Make sure that each application is using a different application pool.
I encountered the same issue and as soon as I change the app pool of the other one, it worked!
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.
I ran iisreset and it took just 1 sec to finish the execution, and boom, I was back into the game.
P.S. I am using chrome
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.
or
close your application, reset iis then open your application and run it
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.
Very basic - but check that if you try to run the web site from IIS by clicking on "Browse", the site actually runs.
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.
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 may be because another debugger is attached".
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
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 :)
I ran into this issue when trying to debug (2) separate solutions in VS.NET and both 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.
The solution: run project 1 from VS.NET (place any needed breakpoints) and start the second 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).
This happens to me quite a bit in VS 2010 express - Usually because the debugger stopped responding.
Right 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.
Done!
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
Had the same problem, even after a reboot. Basically did this:
Restart IIS
Clean Solution
Rebuild Solution
Then it started working again.
This can also be caused if your website uses a database connection but the database server is unavailable.
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.
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.
Once I started MSSQLSERVER , the message "Unable to start debugging on the web server. The web server did not respond in a timely manner" no longer appeared and normal service was resumed.
I had to recreate the site/application/virtual directory to make it work after I installed vs2015 update3. Hope this helps someone. ;)
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:
Close Visual Studio
Find Turn Windows features on or off in Control Panel
Uncheck Internet Information Services in the popup dialog
Restart your computer
Check Internet Information Services in the same dialog, and make sure Internet Information Service -> World Wide Web Services -> Application Development Features -> ASP.NET also been checked
Open Visual Studio, and now your application should be able to run in debug mode
Open
Options and Settings Under the debug
Symbols and unchecked Microsoft Symbol Servers
build solution
iisreset
F5 solution
(Be sure Microsoft Symbol Servers unchecked again)
This worked for me by #mtkachenko
Visual Studio 2012: Unable to attach the process. A debugger is already attached
"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"
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
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:
From within visual studio-->Open Website--> Local IIS -->Select your project
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.
What worked for me was going (xp machine) to add/remove programs --> Add/Remove Windows Components--> Click on IIS--> Click on "Details". Be sure to have Front Page Extensions installed if you are debugging through IIS.
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.
I just solved this problem on my machine.
My problem is that I upgraded IE 9 To IE 10 and I got this error.
Solution : Remove IE 10 and downgrade to IE 9.
Go to "Programs and Features" --> "View recent updates" --> find IE 10---> Uninstall it-->reboot--->ie 9 is back--->debug--->works OK.
Try performing either of the following steps to resolve your issue:
Restart your IIS Server
Clean the Solution of your project then build again
If above steps do not help, you can finally try restarting your machine
In your cmd type iisreset and press enter after that your iis is reset and your application is working perfectly

Resources