gpt4 book ai didi

asp.net - 错误请求 - 无效的主机名 ASP.net Visual Studio 2015

转载 作者:行者123 更新时间:2023-12-03 10:49:33 24 4
gpt4 key购买 nike

在 Visual Studio 2015 中调试我的网站后,我可以通过 localhost:50544 访问它。我想在同一网络上的另一台计算机上访问我的网站。为此,我应该能够访问该计算机地址 192.168.1.13:50544。

但是,当访问此地址时,我收到“错误请求,无效主机名”错误。即使我在提供网站的同一台机器上访问它。

听从建议here我创建了以下 Windows 防火墙规则,并尝试完全关闭防火墙。 picture of firewall rule

我正在使用 IIS express,因此已添加到“~\Documents\IISExpress\config\applicationhost.config”文件中

<binding protocol="http" bindingInformation=":8080:localhost" /> //original rule
<binding protocol="http" bindingInformation="*:50544:192.168.1.13" />

但是在任何机器上访问 192.168.1.13:50544 仍然会导致“错误请求”错误。

最佳答案

您必须 以管理员身份运行 Visual Studio

在 Visual Studio 2015 中,applicationhost.config位于项目本身的文件夹中。 ESC MyProjectName\.vs\config ,请注意 .vs文件夹可能被隐藏。从那里更改 Ip,而不是 IISExpress 文件夹。

您的 <binding protocol="http" bindingInformation="*:50544:192.168.1.13" />是正确的。

关于asp.net - 错误请求 - 无效的主机名 ASP.net Visual Studio 2015,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35247847/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com