intermittent 'unable to start debugging on the web server...' in VS2012 - iis-7

There are a number of questions on stackoverflow relating to being 'unable to start debugging on the web server...' but I have variation of this problem: it's intermittent and it goes away if I restart VS2012. This would tend to indicate that some process or other is locking up another process, or a file is locked, etc, etc by devenv.exe (ie VS2012) and closing VS unlocks the file/process/whatever.
The Visual Studio solution contains a number of MVC4 websites that use IIS running on my 64-bit Windows 7 development computer. All the website, domain model and test projects in this VS solution are configured for .NET 4.5. MvcBuildViews is set to true in the CS project file.
I've tried recycling the IIS application pool for the start-up project, stopping and starting the IIS site, resetting IIS completely, to no avail. I have a suspicion the error message may actually be incorrect, but it's only a suspicion. Any ideas anyone?

Related

VS2010 Debug web app causes "cannot start application" and "access denied" errors

When I try to debug my VS2010 web app (F5), the IE web browser windows pops up but then freezes, and my VS2010 IDE window pops up an error message:
Unable to start program 'http://localhost:nnnn/Login.aspx'.
Access is denied.
I'm running VS2010 (10.0.30319.1), targeted to ASP.NET 4.0 (4.0.30319), in non-administrator mode, with ASP.NET debugging enabled, on 64-bit Windows 7 Enterprise SP1, with IE 9 (9.0.8112.16421 with update 9.0.29).
This web app and others I work with have been working just fine for several months, but they all started to misbehave in this manner a few weeks ago. At first, the first time I tried to debug (F5) I'd get the error, but after clearing it and closing the IE window and trying F5 again a second time, the browser would come up just fine. I assumed it was just some glitch, so I tolerated it.
Lately, though it has gotten worse, to the point that 90% of my attempts and re-attempts to debug the web app cause a hung browser and the error. It sometimes works, but most times it doesn't. I have to kill the handing iexplorer.exe processes to clean up my user space, otherwise I eventually get a message about not having enough files to start the browser. I try rebuilding, stopping the ASP.NET Development Server process, even exiting VS2010 and restarting it, but I can't seem to find the magic sequence of events to get it to work.
If I start without debug (Shift-F5), it works, but two IE web browser windows are opened, and both attach to the web app. I don't know if this is related to the first problem. And needless to say, this does not really allow me to debug my code. I tried attaching to either of the IE processes, but I still could not get the debugger to actually debug the executing app. (There is a message about no symbols being loaded for the attached process.)
Most of the solutions for this problem I've found say something about running with administrator access. I cannot do this, however; I work at a large financial company, and developers are not allowed to have local admin rights on our PCs. I don't control system patches, but I can request Help Desk ticket to resolve the problem; but I'd like to resolve this problem myself if it is a fairly simple configuration problem on my part.
Addendum
I should also add that I am not using IIS (because I don't have it installed on my system, and I can't use it anyway because I don't have local admin rights), but instead I am using the built-in Visual Studio Development Server. I've also selected a specific HTTP port number for it to use. Also, all of the directories I'm been using were created by me (as part of my project workspace), so there should be no access permission problems.
Like I said, I can sometimes get a debugging web session started, but most of the time I can't. So whatever is causing this problem, it is probably something intermittent.
This tend to occur when you try to run the full version of IIS rather than the Visual Studio Web Server or IIS Express. Have you tried running IIS Express instead? I think there's support for IIS Express that came with one of the later updates to VS 2010?
IIS proper definitely requires full admin rights in order to attach a debugger because full IIS runs under a system account rather than your own account. IIS Express (as well as the Visual Studio Web Server) however should run under your own user account and so debugging should work on the local machine even with a non-admin account.
One issue that might cause problems is directory permissions. Make sure that the folder where your Web files live are read/execute accessible through the file system for your user account.
Finally make sure you don't have some other instance of a Web service running on the same HTTP port.
I am having the same issue, it works when i don't choose to debug but CTRL+F5 to start it. F5 Debugger al

When "Use Local IIS Web server" is on, any thrown exceptions seem to hang W3WP process

At our shop, we develop on Windows Server 2008 VMs running IIS 7, same as our production web servers. With VS2010 (and VS2008, but more so 2010), I've been having issues with debugging our ASP.NET applications. If the application throws an exception, I'll often kill the debugger (Shift-F5) so I can correct the faulty code. But after doing this, the process in IIS continues running, with the exception!
This leads to numerous faulty scenarios. Sometimes the exception floats to the top at IIS, and I get a prompt asking "Would you like to debug this process in [choice of Visual Studios]" and other times there is no prompt but the debugger reattaches to the faulty process instead of starting a new one the next time I go to debug.
What am I doing wrong here? Or what is configured wrong? I want the workflow I had back: run web site, see exception, fix code, run web site again to verify fix. Instead I have to manually kill W3WP in the task manager in order to continue working.
Extra info: It may also be related to the fact that the solution contains both a web site application and a web service application which the site application accesses, both running on the local IIS in two virtual directories. Normally the attached debugger will drop into either the web site or service, if either has a problem.
I wonder if there's something else going on that is being hidden. Can you setup Visual Studio to break on all exceptions. From with in the IDE press CTRL + ALT + E. That will open the Exceptions dialog.
By default, the IDE will only break on user-unhandled exceptions. If a different exception is being thrown you might not know about it. Add checks to each checkbox in the "Thrown" column and try running through your code another time. If another exception is being generated, Visual Studio will break on it now.

IIS errors since upgrading to dot net 4

Back in October we upgraded one of our sites (on IIS 6) from .net 3.5 to .net 4.0. Since then we have been getting the following warning and error pretty much everyday:
Warning:
ISAPI
'c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll'
reported itself as unhealthy for the
following reason: 'Deadlock detected'.
Error:
It is not possible to run two
different versions of ASP.NET in the
same IIS process. Please use the IIS
Administration Tool to reconfigure
your server to run the application in
a separate process.
We have checked all applications and ensured that they are running on the correct versions of ASP.NET and also in their own separate app pools.
We have looked at the IIS logs at the time the errors are recorded but this doesn't give any clues as to the issue. Is there a tool available that could give us more information as as to which application is causing the errors and what was happening at the time?
The discussion here might be helpfull for you as well:
You can configure the application pool to orphan the worker process rather than kill it when this condition happens - you can then use adplus to collect a hang dump of the worker process which can be analyzed to figure out what in the process is deadlocked.
(...)
It means that the asp.net thrads have not returned from whatever activity they were doing for a very long time and asp.net has run out of threads - this would normally indicate deadlock. This kb also talks about how to generate dumps for analysis for this condition.
I had the exact same error, and it was due to a .NET 2.0 custom error page that my .NET 4.0 app was referring to.
I had set up a custom error page that was developed in .NET 2.0 and it was applied at the top level of the IIS web site.
The .NET 4.0 application was using a unique MVC URL routing scheme, and for some reason just that application kept locking up and eventually those deadlock errors would come up.
I got rid of the custom error page setting which pointed to the .NET 2.0 web page and switched it back to the default "Not Found" static error. I restarted the application pool and the web page started working without issue.
Hope this helps someone else out there.
http://adamantinewolverine.blogspot.kr/2012/10/running-iis6-in-32-bit-mode-on-64bit.html

Can't debug ASP.NET application stored in IIS

I have a question regarding IIS (version 7.5) and ASP.NET (.NET Framework 4) . I am trying to debug ASP.NET web application which is stored on IIS. Now, I have done this in past and everytime it worked perfectly.
But now when I try to do same, **Visual Studio 2010** always gives me error, **"unable to start debugging on the web server. the iis worker process for the launched URL is not currently running" ...** even the application I had created in past (& stored in IIS) can't debug using Visual Studio. But all applications (new & old) can be accessed if I type their path in Browser, and they work fine too.
I did search on internet about my problem and I found many posts, but almost every post talks about activating **Windows Authentication** in IIS for the application in question. But, I am using Windows 7 home premium and the IIS shipped with this version doesn't support option for Windows Authentication. Also, if this is the only reason then why my old applications were working just fine till now without this Authentication method?? I found MSDN help about this error but it is not much helpful to me. I also checked APPLICATION POOL selection in IIS and my Application (both are using V.4.XX.XXX)... I have also checked **BINDING** , which is *:80 to Default Website, that means all requests to port 80 will be directed to default website (where my all applications reside)
As a side note, I have SharePoint Server 2010 installed. Which has its own website (which I have disabled while debugging) ...
I think there is something is changed in my IIS configuration, but I cant figure out what it is. And I am sure that it has something to do with SharePoint installation (may be because of more than one website on IIS for same port ??). Because I am using IIS for first time after installing SharePoint and I am having this error.
I will really appreciate if any one has answer ...
Thanks,
Jack
UPDATE: As I suspected ... having more than one site in IIS was root cause of trouble, Once I uninstalled Sharepoint Server 2010 and its web sites from IIS, my Visual Studio 2010 debugger was able to "Auto-Attach" w3wp.exe process while debugging any application ... ( I really don't see any reason that even after disabling all other websites why still it was giving me error at first place ?? )
I know its not a solution, because I have to remove Sharepoint Server ... but at present its more important for me to work on that application then Sharepoint Server.
But I am still open for any suggestions which might help me to run both together ....
Thanks,
Jack
Check the Bug fix for this issue in the Microsoft's Connect site.
.
Is it with .NET 3.5 in Visual Studio 2010 , if yes , then check http://www.ginktage.com/2010/08/fix-for-visual-studio-2010-hangs-when-debugging-asp-net-3-5-web-application/ for information

Unable to start debugging on the web server. The COM+ registry database detected a system error

I'm trying to debug an ASP.NET webapp that's configured to "Use Local IIS Web Server" on WinXP. When I start the debugger, the compile succeeds, and then the following error is displayed in a dialog:
Unable to start debugging on the web
server. The COM+ registry database
detected a system error
The webapp never launches in my browser. How can I get rid of this message and debug this webapp?
I tried the usual stuff, and my exact scenario ended up being described a post in the MSDN forums. Its answer worked for me, despite my environment (VS2008, .NET 3.5) being more modern:
Here are the steps I followed (basically a summary of the link above -- "ASPNET" being significant because that's the user running the IIS instance on my development box):
Close VS
Shutdown IIS
Add ASPNET to the local Administrators group
Start IIS
Start VS and successfully debug ASP.NET webapp
Close VS
Shutdown IIS
Remove ASPNET from the local Administrators group
Start IIS
Start VS and continue debugging ASP.NET webapp without error
My development workstation's security settings/situation is regularly managed by our security folks here, so something must have upset my ASP.NET/IIS/etc environment.
I am using the Visual Studio 2002 and I had the same problem, with tha same Error Message. To solve it, I did only the first 5 steps of the solution recommended before.
I am starting in VS 2002 because I use it in my work. I have the basic concepts, but I never develop in this program language, so I am a begginer.
The most important point in this solution I believe it is understand that ASPNET is a user in the development machine, as Administrator, as "Name.LastName" or any other user that access the machine. When I search for ASPNET to add in the Administrators Group and found it, made a lot more sense because I don't know exactly how the .NET architecture works.
So, if you have the same problem, I here confirm this solution solved my problem, even when I reboot my machine:
Close VS
Shutdown IIS
Add ASPNET user of the Machine to the local Administrators group
Start IIS
Start VS and successfully debug ASP.NET webapp
Thanks for the solution!!

Resources