Why asp.net mvc running on a double localhost in IIS Express - asp.net

I'm curious upon running on my web application in IIS Express I saw a double localhost in Browse Applications. Please refer to the screenshot provided. I just want to know why it suddenly appears two localhost, is not normal or anyone can explain why? This is a newly created project.

Most likely you enabled SSL, by entering to your “Project Properties” and setting “SSL Enabled = True”. IIS Express will then host your application on both protocols.

Related

ERR_CONNECTION_RESET with IIS express in Visual Studio 2017

We´ve created a ASP.Net Core Web App and added some controllers. For some reason when I want to run the application, it connects to my local IIS express and the only message that occurs is the following
ERR_CONNECTION_RESET
I don´t try to connect to the port via SSL, so I don´t think it´s a certificate issue.
It doesn´t matter which controller I try to call. For some reason this behaviour appears just on my machine. If I create a new Wep App it works perfectly fine.
I tried the following steps:
Changed the port number in the web server settings in the project properties
Uninstalled IIS Express and reinstalled it
Deleted the hole .vs folder in my project
Host the web app on my local IIS Server
Compared the hole project settings with the project settings of a machine, where it runs fine
I´m stuck on this problem for 2 days now and don´t want to reinstall VS2017. Maybe it´s just a little thing which I´ve missed.
Thanks for your replies :)
The problem was based on my Visual Studio instance. Reinstalling Visual Studio + repairing after this over the VS-installer solved my problem
If your problem is: ERR_CONNECTION_RESET and you said you tried:
Changed the port number in the web server settings in the project properties
Consider that IIS express reserve ports in the range 44300 to 44399.
I had exatly the same ERR_CONNECTION_RESET when i set IIS Express port out of this range.
The solution was to put port number inside this range. Hope it helps you.

Are there any pre-reqs for using Azure AD with ASP.Net MVC on IIS

I have an ASP.Net MVC Web App that has been configured to use Azure AD for authentication. I have configured Azure AD with 2 Reply URLs - one localhost for development and one for production hosting. The site works fine running on my machine on localhost, using IIS Express through Visual Studio. It also runs fine on my machine (and other devs machine's also) when using full blown IIS and the full domain name (mapped locally to my machine through the hosts file). However, if I try to deploy the exact same codebase to a host server (Win 2012 R2 / IIS 8.5 / .Net 4.5) the authentication doesn't work. This is using the exact same URL as works on IIS on my machine.
Does anyone have any ideas what might be preventing my app from running on the server? I have no error messages to go on. After the Azure AD login page I get redirected back to my app where it cycles for a minute or so and just remains a white screen. I have now tried it on 2 separate host servers and got the same result.
Hopefully someone can help, I really need to get this working. Should this just work?
Thanks.
The problem seemed to be just with the one server. I got the process working on other servers and an Azure website. I didn't get to the bottom of what the actual root cause was.

/SignalR/Hubs Not Found

I know there are lots of questions about 404 error of /signalr/hubs folder and i read all of them but none of it is relevant with my problem.
Because normally my code is working on local machine and test server; but same code is not working on production server. This will make me crazy, i tried to recycle app pool, restart IIS or w3svc service but didn't help.
My web site is a secure web site and i think this may cause problem but i couldn't find any thing about running SignalR with SSL.
My project is ASP.Net Web Forms (Web site) and running on IIS 7 on Windows Server Version 6.0 (Build 6002, SP2). App pool is configured to run with .Net Framework version 4.0.30319
P.S: I had another https site which runs signalr without any problems. So i am very confused.
Edit: I had created another web site at same server and copied working codes from working server and tried; result was same. There is something (maybe configuration) about server or IIS.
Solution:
This solution solved my problem too. Actually i had tried this but i got 500 Internal Server Error and gave up. Whatever this is this solution, so i want to change my question what is purpose of this code? Why my site works at another server without this modification?
Ensure that where you're hosting your site is where your signalr/hubs is pointing to. A common issue is that people will host their site like so:
www.abcd.com/mysite/index.html
Now in this example SignalR is hosted at www.abcd.com/mysite/signalr however a lot of people will put /signalr/hubs in their index.html which is wrong. It should be ~/signalr/hubs because the hubs file isn't hosted at www.abcd.com/signalr/hubs it's at www.abcd.com/mysite/signalr/hubs.
Hope this helps!
Use <script src="<%: ResolveUrl("~/signalr/hubs") %>"></script>and that will resolve the problem

Running ASP.net application on IIS - timeout error

I was running my asp.net application on localhost in the internal IIS for Visual Studio and for Testing purposes I was trying to host my website on my LAN at home. I obviously had to switch to use the custom IIS web server. I followed all the steps to do this i.e. I turned on IIS from the windows features in control panel and added my web application to IIS and configured VS settings to use that server and gave it a start URL.
However when I run my project I am getting an error message:
Unable to start debugging on the web server. The web server did not
respond in a timely manner. This may be because another debugger is
already attached to the web server.
What is the cause of this error and how can I solve it?
Thanks
One workaround is to make an empty page and you call the debugger from it as
System.Diagnostics.Debugger.Launch();
To solve it and make possible to start the debugger from the VS you must configure the start up page to see the local IIS on the properties of your project. Also I have notice that if you do not have default browser the IE it may also fail. So for me, to move on, call the debugger from the page.
I have the same problem and I solved it by reseting iis from cmd => "iisreset"

Request.Url does not allow IPs in ASP.NET MVC

I use Requestl.Url in my ASP.NET MVC application to provide a new page the URL of a returning page. Everything works fine, until I tested my page on an android emulator.
There I used http://10.0.2.2/ to address my local host. But Request.Url gives me "http://localhost/".
That is a problem, since "localhost" points to the real local host of the android phone and "10.0.2.2" to my PC's host.
Why does ASP.NET replaces the IP-address by the localhost name? How can I prevent this?
Thanks, Konrad
If I am understanding your post correctly you are pointing the android emulator to your pc and it is redirecting you to localhost
1st note i should point point out if you are using the Cassini development server built in to visual studio you can't do it like that as it will only accept connections from localhost
As the Android emulator is seen as an external device (even tho it is on your computer) Cassini will not likely accept these connections I'm not sure if that is related to the root cause of your problem or not tho
the other option is to set up a dummy URL for local debugging by adding an entry to your hosts file e.g. myapp.local or asp.localhost.app etc. and pointing it to your PC localhost you will need to likely use IIS Express or IIS full for the purposes of debugging and set it up to accept your host file entry as a binding for the given site you are using
I had to do something similar with a Windows iPhone emulator i was using

Resources