I can't reach a particular local web app that is running on IIS - asp.net

I have a web app that used to run on IIS at http://localhost:3878/Admin; however now for some reason I get this error when I try to access it in a browser:
This site can’t be reached
The connection was reset.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_RESET
Why would I be getting this error all of a sudden when the app worked earlier today? I checked in IIS to make sure the app is started. The IIS logs are not showing any requests to this app. Event Viewer shows a compile error related to this app (I tried to access an include aspx page directly from the browser; I want to fix that issue with the web app where it's displaying the source code from the aspx pages that are used in #include statements) but that shouldn't take the app down once and for all should it?

If someone else face ERR_CONNECTION_RESET with http. Then you could try https first. If https binding fix the problem. It would help narrow down the root cause.
You may need to check whether require https has been enabled or mistake. In some case, enable https or HSTS in project will cause ERR_CONNECTION_RESET.
Of course, enable https would be considered as a workaround.

Related

Invalid Hostname on local machine

I have an ASP.NET MVC application that I've been developing and debugging for a while. And when I deploy to a website, it works great.
But something changed and now when I try to run it on my local machine, it compiles and launches the browser with the address http://www.localhost:50821/, but the browser displays an error.
Bad Request - Invalid Hostname
HTTP Error 400. The request hostname is invalid.
I'm really not sure what changed. It was working. Now it doesn't. I'm using the default version of IIS Express that came with Visual Studio 2017.
Any ideas on what I can try?
That URL is bad. Your machine doesn't know how to resolve www.localhost so you get the Invalid Hostname error. Most likely it's supposed to be just http://localhost:50821. Check the Web tab of your project and see if that URL got put in the Project URL somehow. This will cause the debugger to launch with the wrong URL.

set Default.html as start page in Web application

I had played down with my host configurations to the point that I can't revert back! I just want to be able to run it from my own visual studio, so I can debug some javascript and don't care if it is not running on Local IIS. I have web application in VS 2013 (Proj1) that I want to add a default.html page to. I set it as the start page, but when running the app, I keep getting the error:
HTTP Error 500.19 - Internal Server Error The requested page cannot be
accessed because the related configuration data for the page is
invalid.
Luckily, this is my own personal machine and I don't mind resetting its IIS or changing its apps configurations. I've tried the following:
I had initially setup my web application via VS as SSL Enabled = true, but now I am trying to reset, so my project properties look like this:
Even though I don't care about IIS setup, I still looked into my C:\Windows\System32\inetsrv\Config\applicationHost.config file, but looked fine
looked at my web.config, but nothing stands out
I think the process of setting up the SSL is the culprit. Is there anywhere else I should look? I just want to be able to run a simple Default.html
I had a problem very similar to this before in the past. This is what I did to solve it.
Try to debug a very basic page with nothing on it (Make sure that works)
Then start building the page back up.
For me it was when I added "Custom Controls" back in, when I removed those controls from the page everything worked.

How do I set up debugging under my local IIS for an MVC3 app?

My host is having issues getting my MVC3 app to work on their server, so I though I'd check it out myself. Until now I've been too busy developing under the built in server to worry about IIS, but today I tried my first deployment to the host with no joy. Then I tried one to my local IIS, with no joy. Then I tried telling VS to use IIS for debugging, to maybe resolve some local issues, with no joy.
What steps and configuration are required to use local IIS 7.5 to debug an MVC3 application?
EDIT: Going through a browser, after clearing up a permission problem for my Windows user on Temp ASP.NET Files, I now site with a I get a HTTP Error 403 (Forbidden), but the occassional basic auth login dialogue. Here I have tried a Forms auth user, my normal Windows user, and my Windows admin user, all to no avail.
When I try and debug under VS, I get a 500, internal error.
THE PLOT THICKENS: When I enable directory browsing on the site, I get a proper directory listing for the site root url. This suggests the the MVC3 routing is not working, but why not?
If you're getting a directory listing that means there's not a default file set (for IIS6). It usually means the request wasn't routed to IIS to deal with. thing are slightly different with II7 & it's integrated pipeline.
Simon

ASP.NET: Errors not viewable despite proper configuration

I'm having the classic (dare I say typical?) error on the ASP.NET production server, which tells me that I can't view errors. Below the error displayed below, are things I've already tried.
In IIS Manager (6.0), the application is located under one of the web sites in "Web Sites". It is indeed a web application, as opposed to a virtual directory (it has that gear icon).
When trying to view the error from the localhost (i.e. the server itself), it doesn't find the application on its path, even though the root web site works just fine from localhost. It is clearly not a firewall issue because first of all, the firewall is turned off, and second because the root web site works fine from localhost. Heck, I even tried connecting through telnet and that worked fine and dandy too, so it is most certainly and very clearly not a firewall issue.
Basically, I just need to view the error at all. I won't have to fix this problem if I can just see the error and fix it, because obviously there is something wrong in the code itself... I just don't know what, because IIS/.NET won't tell me.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
So what I've already tried is what the error message itself suggests by setting the customErrors thing to "Off". In fact, it always was on "Off" so I didn't have to change anything. I've made sure that the web.config XML is valid.
Another common reason for this error is that the .NET run-time is set to version 1.1, not 2.0. I've also made sure that this is correctly configured to 2.0.
I'm running it in an independent application pool, meaning that there are no other applications at all, much less 1.1 applications, on the same application pool.
I've made sure that EVERYONE can do ANYTHING to the files and directories in the application itself. I understand the security ramifications here, I'm just trying to get it working at all, and then I'll constrain the access rights afterward, one step at a time. But in any case, everyone can read those files.
Any help deeply appreciated. Thank you in advance.
The error is a .NET framework error so it finds the app, but there is a configuration error. What you could do is add some event logging code in APplication_Error handler in global.asax to trap these errors, or turn on health monitoring (<healthMonitoring enabled="true" />), which by default will log ASP.NET framework errors to the event log.
HTH.
Never got this working until I changed the application from a "sub-application" (I don't know the proper terminology) to an independent website with its own hostname. ASP.NET works in mysterious ways.

500 - Internal server error for ASPX page

I have created one test.aspx and my local machine it is working fine. Once I upload the same to server the page is not working. It's showing
500 - Internal server error. There is a problem with the resource you
are looking for, and it cannot be displayed.
It is impossible to help you without getting more info about the IIS configuration on your local machine and the server.
However, here's a quick stab of some things you should look at:
Check if Asp.net is installed on the server.
Make sure your app is targeting the proper .Net version that is on the server.
Check if all the assemblies your code is using are deployed correctly on the IIS server.
Add some exception handling and error logging to your code.
In particular, I'd venture to make a wild guess that your page is using some code that requires the IIS7 integrated pipeline and your server is either running IIS6 or is running IIS7 in classic mode. Though this is a stab in the dark and could turn out to be completely wrong. :-)
500 server errors are as useful as saying 'something broke'. They are the result of literally any exception you code throws plus anything else IIS croaks on. From your error msg, it sounds like an IIS config issue but it could still be your code. attaching a debugger to it would eliminate that possibility.
If you haven't looked at the server event log you can see if it registered anything.
There are a number of things that you can do to try to get a better, more specific exception. One way I try to diagnose them is to connect a remote debugger so I can see what's going on. If you have access to do so, I'd go that route.
You will need admin access to the server to install the Visual Studio remote debugging client (I'm assuming this is a .net app).
Another thing that can help are try/catch blocks and logging to a file or the event log--but have have to change your app most likely to implement that.
You have probably forgotten to upload the associated .dll. Have you tried right clicking on the project and using the publish feature?
If you are using IE, then you also need to turn off the "Show friendly error messages" option in Tools - Options - Advanced settings so that you get more details.
You may also need to change the web.config file so that error message details are shown, see the CustomErrors tag.

Resources