I have a test ASP.NET MVC3 application developed in VS2012. When I start debugging the app is accessed from the host machine via the request to http://localhost:
Except to modify the iisexpress configuration file, sometimes you also need to run the command like below.
netsh http add urlacl url=http://*:49419/ user=Everyone
Some of you might spend a lot of time modifying and testing using your %USERPROFILE% directory. If you are running on VS debug, use $(solutionDir).vs\config\applicationhost.config
This is what worked for me:
C:\VSProjects
in my case)Directory Browsing
from the list of options. On the right side there's a Enable
button. Click it. Now I can access my folder and project bin on the network through mypcname\VSProjects\myProj\outputBinViewer
.
After the above configurations, I had to run the Visual Studio in Administrative Mode.
Thanks to byteit:
Go to applicationhost.config in Documents/IISExpress/config
find the entry for the particular site you are working on:
add:
<binding protocol="http" bindingInformation="*:<your site port>:*" />
in front of the existing
<binding protocol="http" bindingInformation="*:<your site port>:localhost" />
To achieve the solution without having VS2013 create a new website xml entry for you when you restart. You will need to run as administrator.
How to avoid running Visual Studio as an administrator
Using both Garret's and @shangkeyun's answer you can achieve connecting to the running website without needing to run Visual Studio as an admin user:
%USERPROFILE%\My Documents\IISExpress\config\applicationhost.config
name=MySiteName
<binding>
item in the <bindings>
section. You should now have two lines with binding
.It should now look like this, assuming the port is 12345
:
<binding protocol="http" bindingInformation="*:12345:localhost" />
<binding protocol="http" bindingInformation="*:12345:" />
Enable non-admin to bind to port
netsh http add urlacl url=http://*:12345/ user=Everyone
EDIT 2019: gregmac added a step to whitelist the VS instance. I never needed this, but listing it anyway:
netsh advfirewall firewall add rule name="IISExpress visualstudio app" protocol=tcp localport=12345 dir=in action=allow