本地网络中IIS Express上的主机名无效

时间:2019-09-15 12:42:48

标签: visual-studio asp.net-core iis-express

从Visual Studio启动IIS-Express时,我可以连接到我的网站,并且一切正常。 我想使我的网站可以从本地网络访问,所以我尝试了以下操作:

以管理员身份启动Visual Studio(2019社区版)

更改了: launchSettings.json

    {
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:1313/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Skilliam": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:1313/"
    }
  }
}

applicationhost.config

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

防火墙

enter image description here

所有这些更改之后,当尝试从网络中的不同设备进行连接时,我仍然会收到“无效的主机名”。

0 个答案:

没有答案