How can I enable remote requests in IIS Express? Scott Guthrie wrote that is possible but he didn\'t say how.
If you run Visual Studio from Admin you can add just
<binding protocol="http" bindingInformation="*:8080:*" />
or
<binding protocol="https" bindingInformation="*:8443:*" />
into
%userprofile%\My Documents\IISExpress\config\applicationhost.config
Combining answers in this thread, this is how I fixed it(Visual Studio 2019):
Start Visual Studio as an Administrator and Run your Web Service as you normally do.
Find IIS Express icon on the taskbar, right click on it then click "Show All Applications".
Select your Web Service and note the config path displayed below. Click on the config file to open it for editing.
Find your web service(example search for your port) in this config file then find a line like this:
*
:yourport:localhost
Add a new line after that like this:
:
yourport:*
In this case no need to create bindings with specific ip address which could change in the future.
I hope this helps someone out there.
I remember running into the same problems while trying this workflow a few months ago.
Which is why I wrote a simple proxy utility specifically for this kind of scenario: https://github.com/icflorescu/iisexpress-proxy.
Using the IIS Express Proxy, it all becomes quite simple – no need to “netsh http add urlacl url=vaidesg:8080/ user=everyone” or to mess up with your “applicationhost.config”.
Just issue this in command prompt:
iisexpress-proxy 8080 to 3000
…and then you can point your remote devices to http://vaidesg:3000.
Most of the times simpler IS better.
I have some problems using IIS Express in Win 8.1 and external request.
I follow this steps to debug the external request:
It's working!
This is what I did for Windows 10 with Visual Studio 2015 to enable remote access, both with http and https:
First step is to bind your application to your internal IP address. Run cmd
-> ipconfig
to get the address. Open the file /{project folder}/.vs/config/applicationhost.config
and scroll down until you find something like this:
<site name="Project.Web" id="2">
<application path="/">
<virtualDirectory path="/" physicalPath="C:\Project\Project.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:12345:localhost" />
</bindings>
</site>
Add two new bindings under bindings
. You can use HTTPS as well if you like:
<binding protocol="http" bindingInformation="*:12345:192.168.1.15" />
<binding protocol="https" bindingInformation="*:44300:192.168.1.15" />
Add the following rule to your firewall, open a new cmd
prompt as admin and run the following commands:
netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=12345 profile=private remoteip=localsubnet action=allow
netsh advfirewall firewall add rule name="IISExpressWebHttps" dir=in protocol=tcp localport=44300 profile=private remoteip=localsubnet action=allow
Now start Visual Studio as Administrator
. Right click the web projects project file and select Properties
. Go to the Web
tab, and click Create Virtual Directory
. If Visual Studio is not run as Administrator this will probably fail. Now everything should work.
There are three changes you might need to make.
.config
file. Typically:
$(solutionDir)\.vs\config\applicationhost.config
%userprofile%\My Documents\IISExpress\config\applicationhost.config
Find your site's binding element, and add
<binding protocol="http" bindingInformation="*:8080:*" />
netsh http add urlacl url=http://*:8080/ user=everyone
Where everyone
is a windows group. Use double quotes for groups with spaces like "Tout le monde".
Allow IIS Express through Windows firewall.
Start / Windows Firewall with Advanced Security / Inbound Rules / New Rule...
Program
%ProgramFiles%\IIS Express\iisexpress.exe
OR Port 8080 TCP
Now when you start iisexpress.exe
you should see a message such as
Successfully registered URL "http://*:8080/" for site "hello world" application "/"