c# - 如何使用Windows 10操作系统通过IP地址运行visual studio 2017 API项目,我面临很多问题

标签 c# asp.net-mvc visual-studio windows-10 ip-address

我必须尝试很多解决方案但没有人解决我的问题,我需要在 IP 地址(如 192.168.1.8:7832/)中运行我的 visual studio API 项目,但同时同一项目在 localhost:7832

中运行的时间

我必须按照以下步骤...

  1. 像这样更改我的 applicationhost.config 文件

    <bindings>
      <binding protocol="http" bindingInformation="*:1407:192.168.1.8" />
    </bindings>
    
  2. 然后运行如下注释cmd promt

    netsh http add urlacl url=http://192.168.1.8:1407/ user=everyone

这只是告诉 OK

  1. 最后运行如下评论

    netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=1234 profile=private remoteip=localsubnet action=allow
    

但响应是服务不可用

请有人帮助我,在此先感谢...

最佳答案

我收到了同样的服务不可用错误。这是由于错误的编辑。

我实际上是在编辑位于 Documents -> IISExpress -> config 中的 IIS Express 的 applicationhost.config

需要编辑的实际文件位于项目文件夹 -> .vs -> 配置中。 .vs 是一个隐藏文件夹。

关于c# - 如何使用Windows 10操作系统通过IP地址运行visual studio 2017 API项目,我面临很多问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47235197/

相关文章:

c# - File.Copy 目标文件是目录,不是文件。

c# - .NET 实例化错误

c# - 如何在 linq to xml 中为此 xml 数据编写此查询?

asp.net-mvc - 如何在cshtml模板中创建函数?

asp.net-mvc - WebDeploy 发布不上传 PDB 文件(MVC 预编译 webapp,VS2013)

visual-studio - Visual Studio 2017 Javascript linter 突出显示错误

c# - NET Native Tool Chain for UWP 在可移植库中引发 NotImplementedException

c# - 构建网络用户界面

visual-studio - Visual Studio 2010 是否支持 ClearCase

javascript - Angular 和 ASP.NET MVC - 当我将参数传递给后端 Controller 时,参数为空