IISExpress based app doesn't get IP based requests - iis-express

I seemingly applied every recommendation available on net. Yet without results.
My environment:
Windows 10 Enterprise # VM (possibly WMware)
VS Prof 2017 ver 15.5.2
.NET 4.5 Web application
IISExpress with ProjectURL http://localhost:8080 (Created virtual directory)
Following recommendations I did following:
Run as Admin: netsh http add urlacl url=http://:8080/ user=everyone
Added element binding protocol="http" bindingInformation=":8080:" / in C:\Users\myself\Documents\IISExpress\config\applicationhost.config
In Windows Firewall add Inbound Rules: %ProgramFiles%\IIS Express\iisexpress.exe
What I get:
When debugging IISExress-based application from Visual I get to breakpoints by getting http://localhost:8080/myresource from browser but http://myip:8080/myresource (from the same machine!!!) doesn't get me to breakpoint
Inspecting C:\Users\myself\Documents\IISExpress\TraceLogFiles\WebSite1 reveals no trace to the latest request.
Running from IISExpress from Admin/Cmd as "c:\Program Files\IIS Express\iisexpress.exe" /path:"C:\myapp.Web" /port:8080 /trace:e is also unsuccessful. BTW, it starts with suspicious "Successfully registered URL "http://localhost:8080/"". Where is my ip??!!!

Related

Unable to launch IIS Express Web Server - Failed to Register URL - Cannot create a file when that file already exists | VS Community 2017

In VS Community 2017 (v15.9.26) I am unable to debug as IIS Express Web Server Produces the following error.
Output for IIS Express: Failed to register URL "localhost:xxxxx/" for site. Error description: Cannot create a file when that file already exists. (0x800700b7)
Steps to try to resolve the issue
Clean, Rebuild, Restart VS, Restart Computer
Deleted the IISExpress folder and re-ran VS SA Source
Deleted the .vs folder and re-ran VS
Created a new virtual directory SA Source
Re-cloned repo in a new directory and started from scratch
Running netsh http show urlacl showed no other process using port
Removed the ComponentModelCache from the VS AppData
Re-installed VS Community 2017
Implemented a confirmed working applicationhost.config with updated references to my paths, still same port issue.
Re-installed IIS 10.0 Express
Turned off anti-virus
I should note that I have three startup projects running. Two of the projects (with different ports) run fine so I can rule out firewall or SSL issues. The third startup application only produces this error.
After trying all 7 steps and resting my computer multiple times I am stuck. Any further solutions/fixes to try would be greatly appreciated!
Try checking your IIS Manager maybe one of your app is running address.
open IIS manager, check sites and maybe disable one and try again.
I found two temporary workarounds in order to bypass the VS error.
Assign a different port number to the application
Comment out the specific binding protocol in the .vs\config\applicationhost.config
I am still looking for a more sustainable solution.

Cannot connect to IIS Express

I have two Windows 10 machines. One I can start up a debug session by selecting of typing F5 and the other gives me a message that I cannot connect to IIS Express.
Starting up the debugger on the machine that doesn't work shows:
Starting IIS Express ...
Successfully registered URL "https://localhost:44342/" for site "BSoftSolutions" application "/"
Registration completed for site "BSoftSolutions"
IIS Express is running.
Failed to register URL "http://localhost:51136/" for site "BSoftSolutions" application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)
I have been unable to find the differences in these two machines that would cause Visual Studio to fail to connect to IIS?
I install jexus and ran a project diagnostic which gave me this report
IMPORTANT: This report might contain confidential information. Mask such before sharing to others.
-----
Scan the folder C:\Users\RKevi\Source\Repos\BSoftSolution\BSoftSolutions for project files.
1 project(s) are detected.
* BSoftSolutions.csproj
Project file: C:\Users\RKevi\Source\Repos\BSoftSolution\BSoftSolutions\BSoftSolutions.csproj.
IIS Express configuration file: C:\Users\RKevi\source\repos\BSoftSolution\.vs\BSoftSolutions\config\applicationHost.config.
Analyze ASP.NET Core project.
Visual Studio launchSettings.json: C:\Users\RKevi\Source\Repos\BSoftSolution\BSoftSolutions\Properties\launchSettings.json.
Extract debugging profiles.
Found 2 profile(s).
* IIS Express
* BSoftSolutions
Extract IIS settings.
sslPort is 44342.
applicationUrl is http://localhost:51136.
Binding localhost on *:51136 (http).
Binding localhost on *:44342 (https).
A matching binding is found for https://localhost:44342/.

IISExpress keeps refusing connections from custom domain

Tried both Visual Studio 2015 and 2017 with the latest updates, different web apps (.NET Framework and .NET Core based). IISExpress is 10.0, Windows 10 Pro.
When I run a web app like http://localhost:49217, it works. If it's http://mydomain:49217, I get "mydomain refused to connect". At the same time, if I do "ping mydomain", it's successful.
I did:
"mydomain 127.0.0.1:" in hosts file
<binding protocol="http" bindingInformation="*:49217:mydomain" /> in applicationhost.config (both replacing localhost entry and keeping both localhost and mydomain)
made sure that this is the actual applicationhost.config (as there are many locations of them in different Visual Studio versions). For instance, when I change settings directly in Visual Studio, I see that this file gets updated.
"netsh http add urlacl url=http://mydomain:49217/ user=everyone" under Admin privileges
I tried to run Visual Studio as Admin and also running IISExpress directly (also as Admin):
C:\WINDOWS\system32>"c:\Program Files\IIS Express\iisexpress.exe" /config:"c:\solution_path\.vs\config\applicationhost.config" /site:"solution"
Starting IIS Express ...
Successfully registered URL "http://localhost:49217/" for site "solution" application "/"
Successfully registered URL "http://mydomain:49217/" for site "solution" application "/"
Successfully registered URL "http://*:49216/" for site "solution" application "/"
Registration completed for site "solution"
I then see incoming connections when it's localhost but not mydomain.
I tried to turn off Windows Defender Firewall for Private and Public networks, to no avail.
What else can I do?
EDIT:
I now tried to run one of web apps (.NET Core one) under Kestrel and this worked from the start, I can access http://mydomain:49217 just fine. It's only IISExpress which isn't working, and I have to to use IISExpress, Kestrel is not an option for me.
You could install our free VS extension called Conveyor (in Tools->Extensions). It will open a new port that will accept connections from other host names.
Eg. it will open port 45455, then you can go to http://mydomain:45455
You won't need the binding changes anymore, but you will need to keep the hosts file change of course. Also you can signup for tunneling if you want to use one of our subdomains to access over the internet.

Need to name websites on localhost running on different Ports

I have my development PC on Windows 7 for ASP.NET and running Visual Studio 2010 and IIS 7 (NOT using the development web server). I have created multiple websites on different ports on my PC. E.g. http://localhost:8080 points to Website A. But when I open the site in Visual Studio, the project name shows as http://localhost:8080, as follows.
I would like to change that name to http://WebsiteA or http://WebsiteA:8080. Some identification.
I edited hosts and added
127.0.0.1 WebsiteA
Ping works fine. Also browsing WebsiteA:8080 works fine. But when I try opening the site (http://websitea:8080) in Visual Studio, it says Web site does not have Frontpage server extensions installed.
Is there any way to at least rename what's shown in the project list in Visual studio. I just need an identification on each website. I have about a dozen project and more may be added.
Thanks
IIS in Windows 7 allows you to have named virtual hosts. You can use that to separate out your sites. Visual studio cooperates with the naming of the virtual hosts. You will need to configure your visual studio project to operate against IIS (for debugging and running) rather than the visual studio built in web server.
Managed to find a way. This is what I did. Went to IIS Management, Created a new Website - Give it a name WebsiteA, Choose the folder where the web is located and give it a Host Name - WebsiteA. Click OK
Then go to Application Pools. You'll see your Host name there. Change the ASP.Net version to 4.0 or whatever you want. Then add a hosts entry 127.0.0.1 WebsiteA.
Now you can add http://WebsiteA in Visual Studio.
Thanks for all the help guys

Problem "F5" Debugging ASP.NET Web Application Project with VS2008 on Vista

Greetings!
I'm working with a .NET3.5 Web Application project in Visual Studio 2008 on Vista Ultimate. I'd rather use IIS7 than Cassini as my local test web server. I have the website setup in II7 and every thing is served with no problems.
However, I'd like to use the VS debugger hooked up to F5 instead of manually attaching to the process. So in my HOSTS file, I have:
127.0.0.1 mysite.com
In my website project's "Web" settings, I have:
"Use Local IIS Web server" is selected
Project Url is "http://mysite.com"
Override application root URL is "http://mysite.com"
Also, in IIS, I've bound mysite.com to 127.0.0.1 on port 80. In addition, the account used to run the IIS server is a member of the Administrators group and I run VS2008 as Administrator.
However, starting my project with debugging yields this error:
Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running.
Any ideas why I can't get VS debugging to work with IIS?
Problem solved. Instead of binding to 127.0.0.1, I changed it to "All Unassigned" and I'm back in business :)
We fixed it by replacing "::1
localhost" by "127.0.0.1 localhost" in
the hosts file.
Found this in the ASP.Net Forums:
http://forums.asp.net/t/1394972.aspx
Not sure it will help but worth a try...

Resources