35
votes

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...

12
Can you provide event log information for the error?bniwredyc
Seems like a configuration problem!Numan
Good tip (should do myself). The worker process failed to initialize correctly and therefore could not be started. The data is the error.Budda
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 advanceBudda
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.Numan

12 Answers

55
votes

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.)

4
votes

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.

3
votes

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

2
votes

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.

2
votes

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.

1
votes

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

1
votes

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

1
votes

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.

1
votes

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..

0
votes

Struggled with this issue for some time. The error caused the application pool to fail. I would restart the application pool on IIS and it would just fail again.

Only to find that the issue was caused by a folder path specified in the Web.config appSettings that didn't exist. Every time the folder is referenced, the error would occur. I then created the folder path as specified in the config and the error stopped occurring.

-1
votes

This could be due to many of the reasons.In our case, this was due to the website account settings. Service account Password were wrongly configured for the website properties in IIS.

-3
votes

do aspnet-iisreg -i and it will solve your error.