Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2012 使用IP地址而不是本地主机浏览网站_Visual Studio 2012_Iis Express - Fatal编程技术网

Visual studio 2012 使用IP地址而不是本地主机浏览网站

Visual studio 2012 使用IP地址而不是本地主机浏览网站,visual-studio-2012,iis-express,Visual Studio 2012,Iis Express,我正在将VS2012与IIS Express一起使用,似乎无法使用我的IP地址浏览我的网站。有什么办法吗?它过去在VS的早期版本中运行良好 例如,此地址工作正常: http://localhost:64651/ 但是,这个地址不起作用 http://192.168.252.165:64651/ 我确定IP地址,因为我刚刚使用ipconfig获得它。转到您的IISExpress>Config文件夹,找到applicationhost.Config。更改如下: <bindings>

我正在将VS2012与IIS Express一起使用,似乎无法使用我的IP地址浏览我的网站。有什么办法吗?它过去在VS的早期版本中运行良好

例如,此地址工作正常:

http://localhost:64651/
但是,这个地址不起作用

http://192.168.252.165:64651/

我确定IP地址,因为我刚刚使用ipconfig获得它。

转到您的
IISExpress>Config
文件夹,找到
applicationhost.Config
。更改
如下:

<bindings>
      <binding protocol="http" bindingInformation="*:1407:YOUR_IP_ADDRESS" />
</bindings>
这只是告诉http.sys与这个url对话是可以的

重要提示:必须根据系统语言指定user=everyone参数。因此,如果windows语言为西班牙语,则参数必须为user=todos

> netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=1234 profile=private remoteip=localsubnet action=allow
这在Windows防火墙中添加了一条规则,允许本地子网上计算机的传入连接到端口58938。有关详细信息,请访问

端口转发Mac OS X

步骤1:查看当前防火墙规则

sudo ipfw show
步骤2:添加端口转发规则(80到8080)

Tomcat运行的默认端口是8080,所以这里我们展示了从端口80到8080(Tomcat的默认端口)进行端口转发的命令。显然,这也适用于其他端口,您只需相应地调整命令即可

sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in
这是一个临时更改,重新启动后将恢复。如果你想让它永久化,你可以为它创建一个lauch deamon

可选删除规则

如果要删除防火墙规则,请运行:

sudo ipfw flush
在Mac OS X上使用PFCTL(又名PF)进行端口转发

pfctl
的设置类似于
ipfw
。Github用户kujon创建了一个演示如何使用
pfctl
设置从端口80到另一个端口的端口转发


注意:请确保仅通过查找项目名称来更改项目的绑定。您甚至可以保留localhost绑定并添加一个新绑定,这样您就可以使用给定的IP地址和旧的localhost绑定访问相同的网页。

您可以使用Keyoti的传送带。

步骤1:

通过在工具->扩展和更新对话框中搜索“传送带”,下载Visual Studio扩展

步骤2:

输送机自动为web应用程序项目启用,运行(调试)项目并记录远程URL,即您将从设备或其他计算机使用的URL。如果看不到输送机窗口,请参阅下面的故障排除

步骤3:

添加入站防火墙规则,允许访问远程URL中给定的TCP端口

1. Open Windows 'Start' and type WF.msc.
2. Click 'Inbound Rules' on the left.
3. Click 'New Rules' on the right.
4. Choose 'Port' in the new dialog, then 'Next'.
5. Select TCP, and enter the port from the Remote URL next to 'Specific local ports' (probably 45455), then 'Next'.
6. Next, and next (you may want to disable 'Public'), give it a name like 'Conveyor: web dev server access enabled'.
步骤4:

使用设备(手机、平板电脑或其他机器)的远程URL直接访问应用程序


更多信息请访问

127.0.0.1:64651有效吗?否,
http://127.0.0.1:64651/
不起作用。表示找不到该网页。当我将URL更改为
http://localhost:64651/
站点运行正常。是否配置了端口转发?如果Max OS用户看不到,以下是有关的信息。@averasko感谢您提供宝贵的信息。我已经用这些信息修改了我的答案。谢谢你的回复。我使用的是Windows7企业版。如何使用netsh注册IP地址?好的,我可以从我的机器上查看包含本地主机和我的IP地址的网页。但是,也许我应该首先提到这一点,我的iPodtouch连接到同一个无线网络,看不到网页。关键是,我正在尝试为移动设备构建一个网站,而部署到远程服务器在测试更改之间花费的时间太长。我必须更改规则以应用于域。现在效果很好。再次感谢。这个文件夹在哪里?(IISExpress>Config)我正在VS2010上运行它,找不到这个。更新:在这里:C:\ProgramFiles(x86)\IIS Express\config\templates\PersonalWebServer@Rodney文件夹位于以下位置:
C:\Users\{UserNAme}\Documents\IISExpress\config
。最好记录系统驱动器的目录。
1. Open Windows 'Start' and type WF.msc.
2. Click 'Inbound Rules' on the left.
3. Click 'New Rules' on the right.
4. Choose 'Port' in the new dialog, then 'Next'.
5. Select TCP, and enter the port from the Remote URL next to 'Specific local ports' (probably 45455), then 'Next'.
6. Next, and next (you may want to disable 'Public'), give it a name like 'Conveyor: web dev server access enabled'.