HTTP Error 503. The service is unavailable under simple ASP.NET 4.0 web site [closed]
Asked Answered
D

9

36

Something strange happened on my local laptop: my web site that worked locally for a long isn't launched...

Trying to localize the problem I've created a simple web site with 'index.html' file only. It works fine under ASP.NET 2.0, but when I switched App Pool to use 4.0 - it stopped to work.

When I open web site in browser it shows the following error:

Service Unavailable

HTTP Error 503. The service is unavailable.

And causes App pool to stop work also... In the system event log in "applications" section I have:

The worker process failed to initialize correctly and therefore could not be started. The data is the error.

Please advise. Can't find anything related in Google... :(

P.S. I have VS2010, Windows Vista x64, last updates installed, VS SP1 is also installed...

Delinquent answered 24/5, 2011 at 4:42 Comment(3)
Good tip (should do myself). The worker process failed to initialize correctly and therefore could not be started. The data is the error.Delinquent
Configuration? You mean web.config? But it is absent: I've tried on web site with one index.html file... If you mean something else - please advise. I'm not too strong in configuration area. Thanks a lot in advanceDelinquent
I mean .NET configuration. Seems like something wrong with the ApplicationPool(s) and their configuration! I faced a similar issue when I tried and installed .NET FW v1.1 on Windows 7 x64. The application pools refused to start. So I have to repair the .NET FW 4.0 and reset everything to stock to get things working again.Heckle
D
4

I've reinstalled .NET 64 - that helped.

P.S.

It seems like either some files in "C:/windows/Microsoft.net/Framework64/v4.0.30319/" folder or I removed them myself (VS sometimes complains on files in "ASP.NET Temporary files" and their deletion helps)... Probably I didn't pay attention that those folder not a temporary...

P.P.S.

In this case, why VS complained on files in "C:/windows/Microsoft.net/Framework64/v4.0.30319/" folder... ok, now it's hard to say.

Delinquent answered 24/5, 2011 at 7:40 Comment(3)
Check, you may need to re-run aspnet_regiis after re-install/repair from FW 4.0 folderHeckle
I've tried to re-run aspnet_regiis before reinstallin .NET 4.0 - didn't helpDelinquent
This happened to me when uninstalling .NET 4.5.1, the Framework64\v4.0.30319 was almost empty.Baudelaire
F
59

I had to start the application pool that was set for my website and was automatically stopped on some error. (IIS (7.5 in my case)->Application Pools->Start stopped application pool.)

Flem answered 14/1, 2013 at 19:20 Comment(3)
This really helped. I wonder where the specific error (if there is one) is actually logged, e.g. 'Application Pool was not available'Albuquerque
If the app pool starts and immediately stops, your app pool may also have an expired account password. Open the app pool properties and re-enter the identity.Hindi
Thank you! In my case I also had an Application folder inside the main web site, which was using an specific application pool that was stopped! So I was only looking at the main web site app.pool...until now!! Great!Headband
D
4

I've reinstalled .NET 64 - that helped.

P.S.

It seems like either some files in "C:/windows/Microsoft.net/Framework64/v4.0.30319/" folder or I removed them myself (VS sometimes complains on files in "ASP.NET Temporary files" and their deletion helps)... Probably I didn't pay attention that those folder not a temporary...

P.P.S.

In this case, why VS complained on files in "C:/windows/Microsoft.net/Framework64/v4.0.30319/" folder... ok, now it's hard to say.

Delinquent answered 24/5, 2011 at 7:40 Comment(3)
Check, you may need to re-run aspnet_regiis after re-install/repair from FW 4.0 folderHeckle
I've tried to re-run aspnet_regiis before reinstallin .NET 4.0 - didn't helpDelinquent
This happened to me when uninstalling .NET 4.5.1, the Framework64\v4.0.30319 was almost empty.Baudelaire
U
3

Sounds like you forgot to enable .Net 4 extension on the IIS. Try finding and enabling it in ISAPI and CGI Restrictions

http://blogs.msdn.com/b/rakkimk/archive/2007/08/17/iis7-where-is-the-web-services-extensions-option-which-was-there-in-iis6.aspx

Based on the comment it might be that part of the framework was removed and in that case it might be wise to reinstall Framework 4 by first cleaning it up. Try this blog post which got a reference to a tool that automates cleaning up proccess http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx

Unsecured answered 24/5, 2011 at 6:28 Comment(3)
That web site worked few years... and failed today... I remember VS complained, that something wrong with in "C:/windows/Microsoft.net/Framework64/v4.0.30319/" folder (it often complains on files in "ASP.NET Temporary files" subfolder)... now I'm thinking, probably I deleted something from that folder...?Delinquent
you could try to reinstall .net 4 i supposeUnsecured
Not clean-up, .NET 4.0 reinstall helped. See my own answer. Thank you for your help!Delinquent
A
2

There are subtle changes between ASP.NET 2.0 and 4.0 regarding application start up. For instance, you may not access the HttpContext object during the Application_Start event in ASP.NET 4.0. Do you have any code that might hide an exception being thrown because of this?

There are a few problems that may cause the AppPool to stop. One which I've run into myself is that any unhandled exception on a thread other than the request worker thread will cause the AppPool to eventually stop. This is not an immediate problem but eventually it will stop. The ASP.NET runtime keeps track on how frequently your app is failing and if it breaches that threshold the AppPool is stopped, taking down with it, any applications sharing that pool. A StackOverflowException or OutOfMemoryException will eventually have the same effect, these are critical errors and shouldn't be happening in your everyday production code.

I would review the changes between ASP.NET 2.0 and 4.0 and look for unhandled exceptions. You can also change the way Visual Studio handles exceptions (check under Debug > Exceptions) and break when they are thrown regardless if they are handled or not, this is a quick but very verbose way of finding any exceptions.

Aerostat answered 24/5, 2011 at 6:22 Comment(9)
According to logs AppPool stops due to 5 in a row errors... "Application pool 'Test' is being automatically disabled due to a series of failures in the process(es) serving that application pool."Delinquent
As I told in original post, I tried to do test with simple index.html file (no code inside, only simplest HTML): web site with this file work under .NET 2.0, and fails after switch to 4.0... :(Delinquent
Okay, go into Visual Studio, and in the main menu enter Debug > Exceptions click the checkbox "Thrown" next to the "Common Language Runtime Exceptions" entry. Run your app now. Visual Studio should break at the first sight of any exception. If you need to go beyond your code you can also disable "Just my code" from the debugger settings in Visual Studio. This will allow you to spot any exception regardless from where it is being thrown.Aerostat
Have you tried just creating a blank ASP.NET 4.0 project with a single index.html file?Aerostat
YES! And that is what I'm trying to tell everybody.Delinquent
The same error :) Did you read question in FULL: Trying to localize the problem I've created a simple web site with 'index.html' file only.Delinquent
It doesn't hurt to be specific and ask you know. Have you tried debugging all exceptions even none user code exceptions? I think you'd be surprised at what you find if you did.Aerostat
In this case asp.net application was not called at all.Delinquent
At this point I would consider reinstalling everything as an option due to the level at which we run into these problems. This seems to have solved your problem as well.Aerostat
D
2

I'd recommend checking the security permissions of the folder used as the site's root. The launch of the worker process is probably failing because it can't read web.config in this folder.

If you're creating a new application in the IIS manager, by default it will create a new Application Pool with the same name. The problem is that this pool runs under a new identity named IIS APPPOOL\yourSiteName (in the Application Pools page this is listed generically as ApplicationPoolIdentity).

This identity does not exist until the pool is created, so the folder is not currently granting read access, and then the worker process fails since it has no access.

If you wish to use this identity you can use the Edit Permissions item on the site's context menu and access the Security tab, edit the folder's Security item directly via Explorer, or use tools like icacls.exe from the command line (recommended for repeatability).

You can also change the pool's identity to be Network Service or a specific user. I would strongly discourage the use of Local System as it grants too many permissions, and Local Service has other restrictions.

NOTE: If you are going to add the ApplicationPoolIdentity in the Security dialog, the IIS APPPOOL accounts don't appear if you use the Advanced/Find options. You have to manually type the whole "IIS APPPOOL\yourSiteName" string, then click the Check Names button to validate - if it is valid the dialog replaces your text with just yourAppName, underlined.

Dejadeject answered 24/5, 2011 at 7:3 Comment(0)
B
1

Go to IIS and change the Application Pool to DefaultAppPool for your web application.

Bellman answered 22/8, 2011 at 17:21 Comment(0)
S
0

I had to update my network credentials and havn't updated the "PhysicalPathCredential" for the application under IIS. That fixed.

Siddons answered 26/12, 2011 at 6:50 Comment(0)
P
0

my only problem was the Application Pool, which showed the stopped icon. I pointed my Application to another AppPool and it's back working. Hope it helps.

Prognosticate answered 8/1, 2013 at 9:12 Comment(0)
S
0

I think in this case if you go to application pools under ur IIS. Look for the application pool on which you are running your website. I am sure it is stopped so just restart it and you will be good to go..

Spoke answered 29/4, 2014 at 11:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.