If you haven’t set
"ASPNETCORE_URLS": "https://localhost:5111/;http://localhost:5222/"
in launchSettings.json, Visual Studio will use the default listening ports. This is expected behavior. You can simply configure it directly in launchSettings.json and the warn wil be gone.
Additionally, from what I test, even if you don’t configure it, the settings in UseKestrel() will override the default URLs. It shouldn’t affect usage.
or you can set the URLs using other methods mentioned in this article.