更换端口号试一下。

查看官方文档

 

PS:

使用帮助命令 -h,可以指定启动配置文件: dotnet run --launch-profile  xxx

dotnet run 提示System.Net.Sockets.SocketException (10049): 在其上下文中,该请求的地址无效。

例如下面的配置文件,假如我们要使用codes-test的配置,可以这样:dotnet run --launch-profile  codes-test

学会看官方文档可以少走很多弯路。

{
  "iisSettings": {
    "windowsAuthentication": false, 
    "anonymousAuthentication": true, 
    "iisExpress": {
      "applicationUrl": "http://localhost:58970",
      "sslPort": 44395
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
	 "codes": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001;http://localhost:9000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
	"codes-test": {
      "commandName": "Project",
      "launchBrowser": true,
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

 

相关文章:

  • 2022-12-23
  • 2021-12-08
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2021-11-03
  • 2022-12-23
  • 2021-09-05
  • 2021-12-28
相关资源
相似解决方案