相比net core 2.0时候的方式,net core 3.0修改webapi运行时的端口号,要简单很多。

net core 2.0的时候需要加一个host.json的配置文件,然后在代码里面加载配置文件,并修改代码,加上WithUrls方法

net core 3.0的现在只需要在appsettings.json文件里面,加上"urls":"http://localhost:2001;https://localhost:2002"。发布程序后,直接运行,就可以达到效果。

效果如下图:

Net Core 3.0修改WebApi运行时的端口号

相关文章:

  • 2021-11-09
  • 2022-01-28
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2021-12-08
  • 2021-08-09
  • 2022-03-08
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
相关资源
相似解决方案