Configure IIS Express for external access to VS201

2019-01-02 17:08发布

I am developing a project in VS2010 and am able to view my site locally via IIS Express. I would like to enable external access over the network.

All my research has sent me to this blog entry: http://blogs.iis.net/vaidyg/archive/2010/07/29/serving-external-traffic-with-webmatrix-beta.aspx, which is helpful but does not seem to show how to configure bindings for a project started in visual studio (I cannot find the screen in the screenshots, and I have edited binding info in applicationhost.config, but it does not seem to be reflected when I run the site from visual studio).

9条回答
浅入江南
2楼-- · 2019-01-02 17:27

We can add multiple binding addresses by editing applicationhost.config of IIS Express

<bindings>
   <binding protocol="http" bindingInformation="*:62217:localhost" />
   <binding protocol="http" bindingInformation="*:62217:192.168.0.5" />
   <binding protocol="http" bindingInformation="*:62218:192.168.0.5" />
</bindings>

Now we can access web site from lan using IP address.

Accessing local sites from Lan using IIS Express

查看更多
只若初见
3楼-- · 2019-01-02 17:27

We made a free VS (2012, 2013, 2015) extension called Conveyor that allows this - you can find it through the Tools->Extensions... menu in VS or on the gallery site https://visualstudiogallery.msdn.microsoft.com/a429dbb7-a982-4541-b401-934375c02c0f?SRC=Home

查看更多
余生请多指教
4楼-- · 2019-01-02 17:37

If you're working with Visual Studio then follow these steps to access the IIS-Express over IP-Adress:

  1. Get your host IP-Adress: ipconfig in Windows Command Line
  2. GoTo $(SolutionDir).vs\config\applicationHost.config
  3. Find
    <site name="WebApplication3" id="2"> <application path="/" applicationPool="Clr4IntegratedAppPool"> <virtualDirectory path="/" physicalPath="C:\Users\user.name\Source\Repos\protoype-one\WebApplication3" /> </application> <bindings> <binding protocol="http" bindingInformation="*:62549:localhost" /> </bindings> </site>
  4. Add: <binding protocol="http" bindingInformation="*:62549:192.168.178.108"/>
    with your IP-Adress
  5. Run your Visual Studio with Administrator rights and everything should work
  6. Maybe look for some firewall issues if you try to connect from remote

The clue is, that Visual Studio got it's own applicationHost.config file!

查看更多
登录 后发表回答