问题描述
There are number of posts on this and I have tried many a things by now. But to no avail. Myself a Winforms Developer basically, started working on this Web stuff few days back as my company is taking Web initiatives.
I have a ASP.Net project and I want to host it on local IIS. In Project properties -> Web
settings I chose Use Local IIS Server
and gave a url as localhost/MyApp
. I tried accessing it on my firefox browser and received error as HTTP Error 503. The service is unavailable.
Previously I got many other errors and I one by one fixed them all. But struck with this one. These are the settings I have in my project
- Application Pool set to ASP.Net v4.0 Classic
- App Pool
Enable 32 bit Application
property is true - App Pool is started
- Project build property set to
Any CPU
for Target framework
But I would like to mention a weird behavior. Following is something that I am facing
- Application Pool is Started
- I try to access my local website (by giving url as
localhost/MyApp
) - I receive the error as
HTTP Error 503. The service is unavailable
- Application Pool is Stopped
I have seen following link and I have already tried it. For the above behavior I reached here. According to this link, Computer name should not have .
in it. I don't have any .
in my Computer name but do have -
in it. Also my domain name contains .
in it. Moreover I can't change these settings as its my office laptop and our TFS settings are bound to our Domain and Computer Names.
Can anyone help me to understand whats happening? Please guide me. Thanks.
Edit
I have following code in Global.asax
. Application_BeginRequest
method is empty in same file.
protected override void Application_Start(object sender, EventArgs e)
{
base.Application_Start(sender, e);
String _path = String.Concat(System.AppDomain.CurrentDomain.RelativeSearchPath, ";",
System.Environment.GetEnvironmentVariable("PATH"));
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process);
MyAppLog.Initialize();
MyAppLog.WriteMessage("Application Started");
}
Update
As per the suggestions in Comment, I am able to run the website from Cassini.
One possible reason this might happen is that the Application Pool in IIS is configured to run under some custom account and this account either doesn't exist or a wrong password has been provided, or the password has been changed. Look at the advanced properties of the Application Pool in IIS for which account it uses.
Also the Event Log might contain more information as to why the Application Pool is stopping immediately on the first request.
这篇关于http错误503服务不可用.应用程序池在访问网站时停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!