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

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

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

 

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

 

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

个人是在 D:\Documents\IISExpress\config调试

也能够以下方法找到:code

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

就能够看到配置的所在位置。blog

 

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

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

            <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>
相关文章
相关标签/搜索