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

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.

Related

Visual Studio 2010 displays IIS 7 page on debug instead of my project

This is my first ASP.NET project so I am a bit of a rookie when it comes to a lot of the configuring of IIS/Visual Studio so bear with me...
I am using Visual Studio 2010 running on Windows Server 2008 SR2. We recently did some updates on the server and now my project no longer loads when I attempt to debug. When I try to debug the default "Welcome" page for IIS 7 loads instead of my project. I am set up to use the development server to debug, not IIS so I don't understand why I get the IIS page. Before the updates the debugger was pulling up my page without any issues.
Any ideas? Thanks in advance!
It looks like IIS is now bound to the port number that Visual Studio Development Web Server was using previously. You can change the port number in the properties of the web site project.
I have found a solution to my issue. I decided to use IIS instead of the Development Server for debugging. After attempting to debug unsuccessfully yet again, I took a look at the identity that was being used in the application pool and I changed to one with more privileges and that seemed to do the trick. Thanks for the suggestions.
I had the same problem but non-of the earlier answers worked.
I am using Windows 7 enterprise 64-bit, IE11, VS2010, Silverlight 5
I have been developing and maintaining a number of Silverlight projects for the past 5 years, and have always been able to debug them within VS2010 using the ASP.NET Development Server. However, on returning from some well deserved holiday, I found that none of my existing Silverlight projects would run in the debugger. In each case there is a Web project set as the start-up project, and in each case on starting the project within VS2010 (with or without debugging) I got the IIS7 web page instead of my application.
I tried creating a new Silverlight web application, and found that this started normally in the ASP.NET Development Server. I checked my source code and found that no changes had been made in my absence.
After a lot of head scratching, etc., the solution was to clear the IE cache. These are the explicit steps I used:
Close all instances of IE and ASP.NET Development Server.
Open Internet Properties from the Control Panel.
Click "Delete" on the General Tab.
In the Delete Browsing History box check the following options:
a) "Preserve Favourites website data"
b) "Temporary Internet files and website data"
c) "Cookies and website data"
Leave the others unchecked
5) Click "Delete" and wait for the command to complete.
6) Close the Internet Properties box.
7) Rebuild ASP.NET project
8) Start (with or without debugging) in VS2010 - it should now load normally.
Hope this works for you.

Debugging ASP.NET in IIS 7

I have searched all the usual but come up empty. I must be doing something silly!
Simply I created a new project, ASP.NET Web App, and wish to use and debug it with the local install of IIS 7.5 on my Windows 7 x64 box.
According to what I have read it should be a simple process; my issue is that Visual Studio will not stop at breakpoints nor at errors etc.
I just don't get it:
Visual Studio is attaching to the w3p process for me automatically.
If I hover over the breakpoints it shows a message saying the same, that it is in the same w3p process.
I am in Administrator context. I manually ran it like so to be sure but in any case if you are an admin it runs like that anyway.
Some notes:
I do not wish to use IIS Express as I require native IIS 7.5 for my tasks, however it does debug in express - no surprise there.
As mentioned above, all this is being done locally.
The path of the virtual directory is pointed towards the project files, as set by Visual Studio 2010. It even set the Network Service as read on the folder structure.
When debugging from VS the web site runs fine, just debugging is the issue.
Maybe it is permissions? The Default App Pool is using the ApplicationPoolIdentity not Network Service... Should it be? I had assumed they we.re one and the same essentially. Although I changed this and no luck unless I didn't do something I should of
Keep in mind here that my issue is semi-unique in that I am not receiving error messages, not even in the event logs... For all intents and purposes it should be working fine, just it isn't.
VS and IIS, and all updates, are applied to date.
Note: I'm familiar with IIS7.5, I run my own public web hosting server. I just never tried to debug
Note: It is Visual Studio 2010 Ultimate
Thanks for your time.
Sigh!
I went back to basics... Uninstalled IISExpress and tested; It worked! Re-installed IISExpress; It worked!.
I guess installing IIS7 native after IISExpress did something screwy? I had ran the register ISS command on IIS7 when I installed it.
Right, so now I have both installed in tandem and they work fine. Thanks for all your help guys, appreciated.
you can try right-click on project in VS go to properties select web from left menu tab. Check if ASP.NET debugger is checked and also you can select Use Local IIS Server and give localhost url there (in project Url textbox) and then Say start debugging from VS and put breakpoints.
I had a similar issue the other day, I attached the debugger to the wrong w3p process, make sure you attach it to the one the app pool identity is running under.
I wanted to write it as comment by I don't think I can add pictures..
Are you sure you are running the same version of dll?
Is your breakpoint filled like this?
or hollow like this?
1st go to ,Program and Feature in control panel and then in that turn on or off windows features. and now check all check boxes(activate features) related to Internet Information server & windows service managers. once this is done run your visual studio as administrator and then attach to right w3p process.

Using IIS7 to debug instead of Development Server

Can someone please tell me what needs to be done to debug a asp.net app using IIS7 instead of the Development server with VS2010. I have found multiple resources online that says how to do it and they all have different steps. I cannot seem to get it to work.
Thanks,
Blake
Install IIS 7
Register ASP.NET with IIS (aspnet_regiis.exe -i)
Configure the web project to use IIS instead of the built-in server:
Remark: You could also checkout IIS Express.
If you mean debug a web application that is running in IIS instead of the development server, then "Attach to process" is the way to go. This means selecting in the debug menu "Attach to process" instead of "Start Debugging". You will see a dialog a bit like the task manager and will need to select the process to attach to. For IIS this will be w3wp.exe. There will most likely be more than one instance of w3wp.exe running - so selecting the right one will be the real trick. Set a debug point in the source - if you're connected to the right w3wp instance the debug point will look as normal rather than having the warning sign (and looking flat and white). I was doing this today and used this as a reference.

"Mixed mode debugging is not supported on Windows 64-bit platforms" when trying to attach to an ASP.NET process using Visual Studio 2008

I am so used to attach a process when debugging ASP.NET application in .NET 2.0 and VS.NET 2005. I don't know what happened to this functionality in VS.NET 2008.
I also don't want to do debugging by starting from the start page because when the application is big enough you don't want it to be compiled and you sometimes cannot catch a case from start and you want to catch that case during that time.
I could't figure this one out.
I am running Vista Ultimate x64 with VS.NET 2008 Team Suite.
Also in the start options of the WebSite Propery pages Server is selected as "Use Default Web Server" and custom server is grayed out which I cannot check. (I don't know if I need some change here but I can't even try that)
On top of it, I tried debugging from default page but in that case what I got is "Unable to start debugging on the web server. Mixed mode debugging is not supported on Windows 64-bit platforms". What? Anyway I get into the configuration manager of the solution and changed the mixed mode to ANY CPU, however no luck.
Going without the help of debugging brings down ASP.NET to the level of PHP or other kinds.
Additional notes:
I am using DotNetNuke 5.0.1 and building modules under that.
IIS 7 is used with Integrated mode.
The key that I have found on 64 bit Vista for debugging is the following.
1.) Ensure that the web application is FULLY running in IIS and not Cassini (http://localhost addresses)
2.) When attaching to the w3wp.exe process, be sure to select the one with a type of T-SQL, Managed, x64 and NOT the one that shows a type of just x64
Following these two steps I have gotten around all of the issues that I have had. Similar to those you list above.
By the way, for anyone else finding this article based on the same error message (at least in my case) was to modify the app pool in IIS. Go to advanced settings, change "Enable 32-Bit Applications" to True. VS2010, Win 7 64 bit.
Okay, it sounds like you're suffering from a couple problems.
1) Automatic startup of the webdev server: This is usually caused by a project in your solution being set to "Always start when debugging". Simply click the project in the solution explorer and hit F4 to bring up the properties window, and change it from "True" to "False". You might need to check all the projects in the solution.
2) Attaching to a process should be done when the site is published to a real IIS, which I'm assuming you're doing. I'm not totally familiar with IIS under Vista, but you'll need to go into it and make sure that debugging is enabled for your web application. If you're doing this, you shouldn't need to bother with the Start Page or using custom servers.
Hope that helps some.
Help came from Mitchel Sellers.
He pointed out that the debug mode was ok however while attaching to the process, the "Attach To" was "Automatic:Native Code".
After changing to only "Managed Code" or simply by selecting "Managed Code" it started working.
Thanks Mitchel.
And here is the final words from Mitchel:
The "Script" option, is for classic ASP scripts, which ALWAYS run in 32 bit mode, thus debugging T-SQL and Script at the same time results in the "mixed mode", as T-SQL is 64 bit by default. Additionally without the "Managed" option selected, you would never be able to debug anyway.
Now, as to why it was different? I'm not sure, but once you change it you should be set to go for the future.

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