I've recently updated a project from netcoreapp 2.2 to 3.0. When I debug the project locally it is running on the default ports 5000
and 5001
.
I have specified specific urls in both UseUrls
and the launchsettings.json
file, but they are all being ignored.
Any idea why these configurations are not being picked up, and why it is resorting to using the default ports? Thanks.
Found the issue.
Our solution was not using the
Startup
's constructor to access the instance ofIConfiguration
. We had a convenience method doing this to only grab theappsettings.json
config, meaning we missed out on any other config .NET Core needed for setting up the app. This wasn't required in 2.2, but obviously is now.Hope this helps anyone else.
Solution Get
IConfiguration
viaStartup
constructor: