发布:2023/12/7 15:35:08作者:大数据 来源:大数据 浏览次数:1037
在vs 2017开发网站应用程序,经常需要调试内网程序,但如果想用手机调试就力不从心,因为地址是localhost在手机上无法显示,若是内网ip能访问即可实现。
方法:
打开项目文件夹,并显示出隐藏文件,或直接在项目文件夹路径输入\.vs\config进入些文件夹,此时文件夹下有applicationhost.config文件,编辑此文件,添加行 <binding protocol="http" bindingInformation="*:50395:192.168.1.103" />,具体看代码:
1 2 3 4 5 6 7 8 9 |
<site name="project1" id="2"> <application path="/" applicationPool="project1 AppPool"> <virtualDirectory path="/" physicalPath="D:\Source\Repos\project1" /> </application> <bindings> <binding protocol="http" bindingInformation="*:50395:localhost" /> <binding protocol="http" bindingInformation="*:50395:192.168.1.103" /> </bindings> </site> |
保存后,重新以管理员身份启动vs即可,若不是管理员身份启动,仍然无效。
© Copyright 2014 - 2025 柏港建站平台 ejk5.com. 渝ICP备16000791号-4