"503 Service Unavailable" when debugging/viewing in browser - asp.net

I have a couple of Web Application/Web Projects created with ASP .NET 4.0 that I work on at home. I opened one up at work today, and whenever I try to debug the project, or right-click -> "View in Browser" an individual webpage, I receive the "503 Service Unavailable" error with "Failed to connect to server localhost" as the full error message.
Now, I've tried numerous of the common fixes, including:
Re-registering .NET Framework 4.0
Re-downloading .NET Framework 4.0
Made sure localhost wasn't pointing to another location
Made sure the .NET Extensibility option was checked under the IIS features (IIS -> World Wide Web Servies -> Application Development Features).
Allowed the ASP .NET v4.0.xxxx setting under "ISAPI and CGI Restrictions" in the IIS Manager.
Yet nothing seems to have worked, yet. The only difference in scenarios where these pages work, and they don't, is the computer I'm opening them on. I'm thinking it may be a Firewall setting, but I'm not too sure what. Any help would be greatly appreciated.

Finally discovered the solution to this problem, figured I would share in-case anyone else encounters the same kind of situation. It turns out this was a browser proxy issue.
If you can't connect to localhost when debugging ASP sites in Visual Studio, change the following settings:
Firefox: Options -> Advanced -> Network -> Settings
Select either "No Proxy" or "Auto-detect proxy settings for this network". When I was receiving this error, it was set to "Use system proxy settings" (I never manually changed this, an update must have).
Internet Explorer: Internet Options -> Connections -> LAN Settings
If it's checked, try unchecking "Use Automatic configuration script". This solved this issue for me, and once again, ASP .NET use to work and I never changed this setting.

Internet Options -> Connections -> LAN Settings
Disable the proxy by uncheking it.

Has a similar problem on Windows 10 on a corporate network. Check IIS and see if copy profile is set to true in the app pool. switch to false.
IIS was updated without a new version number because Microsoft. So a reinstall might fix this for others too.

Related

IIS7 MVC Routing Not Working

Our company ships an MVC based product (targeting v4.5) which has stopped working on a customer site for what appear to be environmental issues - a build which worked with no problems once upon a time now gives a 403.14 - The Web server is configured to not list the contents of this directory.
.
What I think is happening...
The user accesses http://server/AppName
Because it's an MVC app, the default route (Reports/Index) should be used.
Instead IIS is looking for a default document...
... and, not finding one, it assumes the user wants to list the contents of the directory...
...which is not enabled so it throws a 403.14.
.
What I've tried so far...
Accessing the route directly.. results in 404 error. So I'm pretty
sure IIS doesn't realise it should use routing.
Use aspnet_regiis to register ASP.Net with IIS. This was done from the Framework64 folder since...
OS is 64 bit - Windows Server 2008 (Standard without Hyper-V)
IIS is 64 bit - though Enable 32-Bit Applications is true
Checked AppPool is targeting v4 of the framework - it is.
Changed AppPool mode to Classic - was pretty sure it should be integrated but was worth ruling it out. It is now back to Integrated
Confirmed RunAllManagedModulesForAllRequests is set to true in the web.config.
Checked permission conditions defined in <system.webServer> section of web.config are met - they are.
Created the simplest of MVC applications and deployed it - same problem.
Running the command shell as Administrator unregistered ASP.Net using aspnet_regiis -ua and re-registered using aspnet_regiis -enable -i. We hit a couple of permission problems - and the Temporary ASP.NET Files directory was missing but once they were address we were back to the same error.
Added a simple default.htm - when present, this is served in response to the http://server/AppName request.
I'm clean out of ideas and all google hits suggest some combination of the above - or enabling directory browsing (which I think is just a symptom rather than the root cause).
Also, not sure if it's relevant but the amount of configurable elements available for the application in IIS seems a bit below what I would have expected...
Have you Checked the user the application pool process is running under? I think Your site needs to run with permissions to execute the .net libraries and I've seen this just change for seemingly no reason (probably related to an overzealous update to the system).
You can try with the Enabling directory browsing .
assuming you are under Windows Server 2012 or Windows Server 2012 R2
On the taskbar, click Server Manager.
In Server Manager, click the Manage menu, and then click Add Roles
and Features.
In the Add Roles and Features wizard, click Next. Select the
installation type and click Next. Select the destination server and
click Next.
On the Server Roles page, expand Web Server (IIS), expand Web
Server, expand Common HTTP Features, and then select Directory
Browsing. Click Next.
On the Select features page, click Next. On the Confirm installation
selections page, click Install. On the Results page, click Close.
if you using the Windows PC try this in your command prompt as follows:
go to C:\Program Files\IIS Express
then press Enter:appcmd set config
/section:system.webServer/directoryBrowse /enabled
Maybe this is your case https://forums.iis.net/t/1157304.aspx
SQL Server Reporting Services creates a folder called Reports by
default if you install it on IIS. If you install SQL 2008 then
Reporting Services doesn't need to use IIS and instead will try to
reserve the URL with the HTTP.Sys service.
I believe this is the cause of the conflict you are seeing. What you
could try is changing the URL that Reporting Services uses via the SQL
Server Configuration Wizard.
Also I found that
Report Manager of SQL Server can use reports path http://<server name>/reports
Configure a Native Mode Report Server for Local Administration (SSRS)
I think the problem is IIS features that are not installed yet. I have met this kind of problem frequently in Windows Pro. Make sure to turn on every feature under Internet Information Service -> World Wide Services because by default IIS is configured to use WebForms. So there might be some features that not installed yet to use MVC, especially ISAPI filters. In my case, that was the solution. I hope it helps.
Something similar i encountered using VS 2017 & ASP.NET MVC.
Was working on the project for long with no problems at all but suddenly the routing started misbehaving & stopped working.
So I changed the Port in Project Properties Page & it started working.
I really don't know what is the relation between a port & MVC routing modules. Someone else can enlighten if at all this helps.
I had the same problem and I just created an application pool out of the Default Web Site in IIS and stoped the default web site. With that difference you will not have the application pool's path
I know it's been a long time since this question but i've had the same problema recently. I've tried every single configuration, just like #amcdermott did, but the only action that solve the problem was reinstalling .NET Framework.
My app was built under .NET Framework 4.5.2. The application server had the version 4.6.1 and 4.5.2 installed. So, i uninstalled all framework versions and installed the one that i needed.
Please, make sure that no other applications use superior versions of .NET Framework if you going to try this solution.
Here are some quote I find on Microsoft official site which I think may help:
For site administrators
This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. To resolve this problem, use one of the following methods:
Method 1: Enable the Directory Browsing feature in IIS (Recommended)
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Directory Browsing.
In the Actions pane, click Enable.
Method 2: Add a default document
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Default Document.
In the Actions pane, click Enable.
In the File Name box, type the name of the default document, and then click OK.
Method 3: Enable the Directory Browsing feature in IIS Express
Note This method is for the web developers who experience the issue when they use IIS Express.
To do this, follow these steps:
Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt:
C:\Program Files\IIS Express
Type the following command, and then press Enter:
appcmd set config /section:directoryBrowse /enabled:true

Unable to run website with ASP.Net version 1.1; while 4.0 works

ASP.Net application (Version 1.1) that was working fine in live environment.
I encountered a problem all of a sudden that some of the functionalities stopped working. I tried simulating the problem in test environment. I found it is with ASP.Net version under IIS -> Websites -> Mywebsite -> properties -> asp.net tab -> asp.net version. Changing that version from 4.0.xxxx to 1.1.xxxx worked.
But when i did the same in live, it isn't.
I tried browsing the page and i get the message saying "page cant be found".
I ran "C:\Windows\Microsoft.Net\Framework\v1.1.xxxx\aspnet_regiis -u" first C:\Windows\Microsoft.Net\Framework\v1.1.xxxx\aspnet_regiis -i after that.
Once this registration is over, I checked the asp.net version in the iis for Mywebsite, it got changed back to 4.0.xxxxx I really dont know why it's happening.
I could access the pages with 4.0.xxxxx but i will need them to be accessed with 1.1.xxxx
Can someone throw some light please?
Environment: Windows Server 2003
I got the answer!
It was happening due to some microsoft patch updates. That turned web service extensions for asp.net 1.1 to be blocked.
I followed the below steps to get it working!
Go to IIS (The version i use is 6.0)
Expand Machine Name
Click Web Service Extensions
At the right side i could see the available .Net frameworks. Right click ASP.Net v1.1.4322 > Allow. That's it. Problem solved.

Visual Studio 2008 - ASP.NET Web Service Application - Cannot consume web service

I'm running on Windows 7
I have a ASP.NET Web Service Application project in Visual Studio 2008.
I tried to test the Web Service(even with just the initial Hello World Method) : Build Solution, Start Without debugging -> The ASP.NET Development Server starts (localhost: 49345) but the browser (Chrome, Firefox, IE) says : could not find localhost:49345 (http://localhost:49345/Service1.asmx).
I thought it might have something to do with IIS so I went into Control Panel -> Programs and features -> Turn Windows Features On and OFF and I selected the Internet Information Servicess clicked OK instaled and restarted the PC. Tried again but got the same error message.
I don't know what the deal is. I've tried same thing on my Vista Laptop ( Control Panel -> Programs and features -> Turn Windows Features On and OFF -> Internet Information Servicess not installed ) and it worked flawless as it should. I read somewhere though, that these web services don't go through the IIS , instead they go straight through the ASP.NET Development Server in the Vistual Studio.
Also I've tried to disable Windows Firewall. Still no go.
Any advice is welcomed and great.
Please help as quickly as you can.
Thanks
http://localhost:49345 is different from http://localhost:49345/Service1.asmx.
I would suggest from the visual studio, right click on your asmx file and select view in browser. It would resolve the address of asmx and show you the asmx content. This would be a good start to see what is wrong (if something is really wrong)
I figured out what it was.The "hosts" file in the C:\Windows\System32\drivers\etc\ folder
Had the problem : besides localhost there were several other things assigned to the 127.0.0.1
I commented all the other lines with 127.0.0.1 except for the 127.0.0.1 localhost.
Saved the file.
Tried again -> Worked like a charm.
Thaks guys for your help.

Could not start ASP.NET or ATL Server debugging

I installed Visual Studio 2003 on Windows 7 but I am getting the following error on when I press the F5 for debugging.
Error while trying to run project: Unable to start debugging on the web server.
Could not start ASP.NET or ATL Server debugging.
Verify that ASP.NET or ATL Server is correctly installed on the server.
What does that mean and how do I fix it?
The cause for this as per microsoft support is -
This problem occurs because the debugger does not send the debug action to IIS when you run the application. The debugger identifies your computer as localhost. However, in IIS, the Web Site Identification of the application is the IP address that you specified
The resolution is as given below -
http://support.microsoft.com/kb/814717
http://forums.asp.net/t/703333.aspx
I found answer :
iis manager -> computer name -> ISAPI and CGI restrictions -> aspnet v1.1... -> select allowed
(dont forget restart IIS.)
I tried all the options but in vain. My solution was:
Go to properties page of the application in VS2010
a. check you have selected 'Define DEBUG constant'
b. check you have selected 'Use Visual Studio development server' under the Server.
i) select 'Auto-assign Port'
c. check you have selected 'Apply server settings to all users'
d. check you have selected 'asp.net' under Debuggers
Mine all the above were messy. I did the same and it worked.
May be you have to install another server on your computer, so it conflict with IIS server. You have to change another server port address or remove from your computer.
Simple steps to solve this error!!
Make sure the following things are intact:
Check if your application pool is stopped. If so, start it.
Also make sure the framework of the pool matches with that of your application.
Virtual directories in IIS need to bear the same name as its
original application directory
Clear Temp files, Temp ASP files, delete the worker process of the application and restart your IIS.
Here's a link that will help you setup ASP.Net 1.1 and its requisites, in case, the above didn't help you.
How to setup asp.net v1.1

Can't access localhost/iis after installing Oracle and loopback adaptor

Recently I installed Oracle and the required Microsoft Loopback Adaptor, which worked fine. However, this seems to have screwed up IIS (or at least its interaction with Visual Studio) somehow. I can't connect to localhost or 127.0.0.1 anymore, and I can't even open a web project in Visual Studio 2008 (which used to work fine), getting the error "The local IIS URL http://localhost/MyProject specified for the Web project MyProject has not been configured. In order to open this project the virtual directory needs to be configured. Would you like to create this directory now?" I click yes, then it gives an error that it "could not find the server http://localhost on the current machine".
IIS is running and I can connect to the default IIS website and other contents of inetput/wwwroot on localhost:1122.
I tried to disable the loopback adaptor and comment out the line I needed to add to hosts to get Oracle working, and while this has stopped Oracle from working, it hasn't helped with IIS/localhost.
edit: this turned out to be fixed by restoring the project from a backup, so it must have been an issue with the project itself of some sort.
I am guessing it's a problem with the loopback adaptor. You might have to restore your Connection settings properly. Check whether the loopback adaptor is properly disabled and whether Connection settings are correct from Control Panel->Network Connections.
Edit:
Also it would be better to restart the system after you have made all the necessary changes in the settings.
You could configure your local IIS to listen on a different port. Right click Default website, tab Web site, then Advanced. Add for example 1234 as a TCP port.
Then you can connect like http://localhost:1234/YourProject
You can open the website in Visual Studio from the file system, and specify the new URL in Project -> Property Pages -> Start Options -> Use custom server.
Ok, I finally managed to get this working by deleting the project and restoring from a backup. I guess the project configuration had somehow become screwed up in such a way as to cause the error I got, rather than there being a problem with IIS itself. Sorry for the false alarm.
Something similar happened to me today on Windows XP and IIS 5.whatever-it-is. The problem is that a tool I installed had created some Virtual Directories without an Application Name under the Default Web Site.
The solution was to open up the IIS snap-in, right-click and choose Properties for the offending virtual directories, and make up an "Application name" under the "Virtual Directory" tab of the Properties dialog that pops up. It didn't matter what I named it, as long as there was no virtual directory under the Default Web Site with a blank application name.

Resources