连接到Visual Studio调试通过LAN IIS防爆preSS服务器 [英] Connecting to Visual Studio debugging IIS Express server over the lan

查看:232
本文介绍了连接到Visual Studio调试通过LAN IIS防爆preSS服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2012开发了一个测试ASP.NET MVC3应用程序。当我开始调试应用从主机通过请求访问,以的http://本地主机:<端口号> 。但是,如果我试图通过 HTTP从远程计算机访问该内部网络相同的应用程序://< IP>:<端口号> 我得到 HTTP错误400:坏请求。无效的主机名。至于它运行在IIS防爆preSS任何服务器配置无法访问。

I have a test ASP.NET MVC3 application developed in VS2012. When I start debugging the app is accessed from the host machine via the request to http://localhost:<portnumber>. But if I try to access the same application from the remote machine in the intranet via the http://<ip>:<portnumber> I get HTTP error 400: Bad request. Invalid Host Name. As far as it runs on IIS Express any server configuration is inaccessible.

有没有解决这个任何方式?

Are there any ways of solving this?

推荐答案

更新

我做了更好的描述过程的视频, https://youtu.be/5ZqDuvTqQVs

I made a video that better describes the process, https://youtu.be/5ZqDuvTqQVs

如果您使用的是VS2013,确保你运行它作为一个管理员这个工作。

If you are using VS2013, make sure you run it as an administrator for this to work.



打开%USERPROFILE%\\我的文档\\ IISEx preSS \\设置\\对ApplicationHost.config 文件。在里面你应该看到这样的事情:


Open the %USERPROFILE%\My Documents\IISExpress\config\applicationhost.config file. Inside you should see something like this:

<site name="WebSite1" id="1" serverAutoStart="true">
    <application path="/">
        <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:8080:localhost" />
    </bindings>
</site>

更改 bindingInformation =:8080:本地主机 bindingInformation =*:8080:*?(端口号,8080在我的情况,会有所不同。)

Change the bindingInformation=":8080:localhost" to bindingInformation="*:8080:*" (the port number, 8080 in my case, will differ.)

然后确保您的防火墙允许该端口上的连接。您可能需要重新启动系统,或者至少视觉工作室得到IISEx preSS重新加载配置文件。

Then make sure your firewall is allowing incoming connections on that port. You may need to restart the system or at least Visual Studios to get IISExpress to reload the config file.

如果这不起作用,(由于某种原因,它只是停止工作对我来说,)看看这个答案: HTTP ://stackoverflow.com/a/5186680/985284

If this doesn't work, (for some reason it just stopped working for me,) take a look at this answer: http://stackoverflow.com/a/5186680/985284

这篇关于连接到Visual Studio调试通过LAN IIS防爆preSS服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆