【VS调试】VS调试的时候使用IP地址,局域网的设备可以访问并调试

使用IIS Express调试,只能通过  http://localhost:端口  进行访问

客户端的设备如何才能通过 http://ip地址:端口 访问后台程序进行调试呢?

 

第一步,打开项目属性,web服务器是默认的IIS Express.

 

第二步,找到项目站点的配置文件 applicationhost.config,一般默认的位置在: C:\Users\userName\Documents\IISExpress\config

我的是在 D:\Documents\IISExpress\config

也可以如下方法找到:

启动web调试后,电脑右下角有个IIS Express图标,点击显示所有应用程序

就可以看到配置的所在位置。

 

第三步,打开applicationhost.config文件,找到项目所在的节点,我的项目名称是MyApp。

添加一行:<binding protocol="http" bindingInformation="*:11946:192.168.137.210" />   ,设置自定义的IP和端口。

            <site name="MyApp" id="4">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="D:\CSharpWorkSpace\MyApp\MyApp" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:11946:localhost" />
                    <binding protocol="http" bindingInformation="*:11946:192.168.137.210" />
                </bindings>
            </site>

 

posted @ 2018-01-30 15:31  发明创造小能手  阅读(1290)  评论(0编辑  收藏  举报
levels of contents