How do I enable IIS Express to serve external requests over Port 80 - iis-express

I am developing a WebAPI in Visual Studio 2022. I wish to share testing of the code under development with a colleague in our corporate network over port 80. I have previously accomplished this under VS 2017 on a different machine using the following technique:
1/ Use netsh to reserve the relevant URL
2/ Add the binding information to the IIS Express Config:
<binding protocol="http" bindingInformation="*:80:machinename" />
3/ Modified the firewall to allow the requests through:
netsh firewall add portopening TCP 80 IISExpressWeb enable ALL
Unfortunately, this tried and trusted procedure doesn't appear to have worked (employed the same technique from VS2010 onwards). What is happening here? I think this should work.

Related

IISExpress remote access

I'm trying to access an API (created with visual studio WebAPI) on a remote computer.
I've followed this guide (https://www.codeproject.com/Articles/805238/Access-IIS-Express-Website-From-Remote-Machine), and I can now access it locally with http://IP:Port but not remotely. But it works when I disable the Firewall on my local PC, however I don't want it to be ad vitam aeternam opened
I've opened the port for ISS express like so in the guide, but it seems I need to open something else, I tried TCP and UDP inbound/outbound (TCP inboud was the one I opened with the guide), but it still don't work.
Thanks for your help.

IIS Express slow on external requests using Parallels VM on Mac

Running a VM on a Mac for a .NET backend, I have the following setup:
Parallels 8 (Shared Network), Win 8, IIS Express 8 (not run as admin I think), Visual Studio 2012 Epress
ACL via elevated command line:
netsh http add urlacl url=http://10.211.55.3:29588/ user=everyone
applicationhost.config
<bindings>
<binding protocol="http" bindingInformation="*:49288:localhost" />
<binding protocol="http" bindingInformation="*:49288:10.211.55.3" />
</bindings>
The usual tutorials about this topic use the win8 hostname, which doesn't work in my case. I have to use the direct IP address. The other thing that is unusual here is that I have to leave the localhost in the bindings, otherwise Visual Studio can't start IIS Express (Error).
Above works except that the backend becomes unresponsive after a minute or so. It's like the server goes to sleep. On browser-refresh (Mac side) I get a timeout, then the requests make it through again. On the Win8 side, the backend is repsonsive all the time.
Does somebody have an idea what I'm doing wrong?
It seems this problem is resolved with VS 2012 update 3.

Visual Studio is setting up my Azure web role to 127.255.0.0:82 instead of 127.0.0.1:80

I have Windows Azure SDK 1.6 installed along with Azure tools. I have one web role (with two endpoints, port 80 for http and port 443 for https) and only have one instance of the web role running (for testing purposes).
When I ran it from Visual Studio for debugging last week, it ran the emulator, attached it to IIS with a binding of 127.0.0.1:80 and everything was peachy.
But as of yesterday, as soon as I started it was trying to bind it to 127.255.0.1:82 and it stopped working with this error (from Visual Studio):
There was an error attaching the debugger to the iis worker process
for URL 'http://127.255.0.0:82'
Now if I manually go to IIS and change the bindings back, I can access the site through a browser but obviously I can't debug it via VS.
Why is Visual Studio doing this? What made it change from last week (I've only made code changes and I have commented them out)?
Edit: I know about this blog, but my issue seems to be different because for one reason I don't have errors in the event logs. And like I mentioned as soon as I change the bindings manually in IIS, I can access the site properly so the app pool is configured correctly.
Edit2: I have the following set:
<compilation debug="true" targetFramework="4.0" />
And my cloud project is set to startup project as well.
When I ran it from Visual Studio for debugging last week, it ran the
emulator, attached it to IIS with a binding of 127.0.0.1:80 and
everything was peachy.
I don't believe you ever debugged a Azure Emulator deployed project on 127.0.0.1:80 binding with IIS. There is a chance that what you've debugged is just the Web Application project and not the Azure Deployed one. Let me explain why:
Windows Azure Emulator uses internal emulated Load Balancer (LB).
This emulated LB binds to 127.0.0.1 port 80 (if port 80 is already
taken it uses port 81)
Windows Azure Tools are dynamically creating a virtual IP address
for every instance of a webrole you have. These dynamic IP Addresses
are 127.255.0.X, where X is the logical number of the instance (0,
1, 2, etc...).
Windows Azure tools creates a website in the local IIS, with binding
of 127.255.0.X and port 82
Step 3 is repeated for every instance you have defined.
When start debugging, your browser usually opens http: //127.0.0.1:81/ which is the address of the LB. But the request from this address is forwarded to the IIS and its binding to 127.255.0.X:82. You could not have debugged a Windows Azure Emulator deployed project by manually attaching debugger to 127.0.0.1:80, because, if everything was fine there is no w3wp process listening on that address:port, but Azure emulated LB.
When you only have the WebRole (no additional sites defined), Windows Azure Tools does know that it shall attach the debugger to 127.255.0.X:82 where a w3wp process is listening.
This is the clean working configuration of Azure Emulator & SDK & Tools v.1.6 (I think also 1.5 and even back to 1.3 where the Full IIS mode was introduced for first time)
Now if I manually go to IIS and change the bindings back, I can access
the site through a browser but obviously I can't debug it via VS.
Yes, you will be able to access the site, but in that way you are skipping the emulated LB, which is not the point when developing Windows Azure Applications.
If you are heving issues of that kind, I suggest that you clean your solution, restart the computer, and if the problem persist uninstall the SDK & Tools and perform clean full install of SDK & Authoring tols for Windows Azure v.1.6 using the Web Platform Installer.

Debugging ASP.NET MVC project in VS2010 and accessing on networked computers

I'm wondering if it's possible to allow users on my local network to connect to an ASP.NET MVC 3 app I'm running through VS2010 on my local PC. The purpose is to let others test during some rapid application development without deploying to a server.
By default, the port seems to be blocked. Is there a setting in VS2010 or IIS Express that I can change to allow access to it?
By default VS sets localhost bindings in applicationhost.config file (%userprofile%\documents\iisexpress\config\applicationhost.config), so you cannot access it from other machines.
To access your site from other machines,
you need to update your site bindings (in applicationhost.config file) and add a site binding with your machinename
Run VS as administrator
If firewall is blocking your port, unblock it
Following link may help you
Configure IIS Express for external access to VS2010 project

Use Visual Studio web server in local network

Is there a way to access visual studio web server from another computer that share the same router? I tried connecting to the IP address but it didnt work. Is there a setting in VS? or firewall?
You can achieve this by installing IIS Express.
Go to
http://www.microsoft.com/en-us/download/details.aspx?id=1038
Once installed, change your project setting to this:
Then go to
%userprofile%\Documents\IISExpress\config\applicationhost.config
and for the project change the binding to this:
<bindings>
<binding protocol="http" bindingInformation=":54715:" />
</bindings>
Note, you can also specify the bindings like this if you just want to limit it to your IP and machine name:
<binding protocol="http" bindingInformation="*:54715:localhost" />
<binding protocol="http" bindingInformation="*:54715:anishaalaptop" />
I debug my app over Wifi using my android app so I leave the binding open.
I assume you mean the cassini web server built into visual studio. In short, no you can't. That cassini web server can only be accessed from the local computer.
I found some further information. According to MSDN, you can't access it from another machine. What are some known functionality limitations of the Cassini Web server?
It can host only one ASP.NET application per port.
It does not support HTTPS.
It does not support authentication.
It responds only to localhost requests.
see this MSDN article http://support.microsoft.com/kb/893391
You can use ngrok or an extension for VS https://marketplace.visualstudio.com/items?itemName=vs-publisher-1448185.ConveyorbyKeyoti . I'm using this extension and it's very useful

Resources