Specifying the url (port) that a asp.net core 1.0 WebAPI.exe should use in program.cs for both prod and dev

冷暖自知 提交于 2019-12-05 21:21:37

When using IIS you are overwriting the url the IIS (AspNet Core Module) told the app to listen to by calling .UseUrls() after .UseIISIntegration(). You should change the order of these two calls so that .UseIISIntegration() is after .UseUrl(). .UseIISIntegration() will not touch urls you set if you are not running with IIS so in development your application still will be listening on port 12012. When running with IIS .UseIISIntegration() will overwrite the url to listen on the port IIS told it to listen on. I wrote a post on running Asp.NET Core apps with IIS and Azure Websites which explains how things work including this nuance.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!