I have an existing ASP.NET 5 application. I can start it normally in Visual Studio 2019 with F5. The app has https enabled.I add docker support to the app, using the Visual Studio tooling "Add Docker Support". The docker file is created normally, the image is built and the container successfully started by Visual Studio. However, then I hit F5 (with the Docker profile), I get the following exception:
Unable to configure HTTPS endpoint. No server certificate wasspecified, and the default developer certificate could not be found oris out of date. To generate a developer certificate run 'dotnetdev-certs https'. To trust the certificate (Windows and macOS only)run 'dotnet dev-certs https --trust'. For more information onconfiguring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
The app continues to work normally if started with IIS Express or Kestrel.Using the suggested dotnet dev-certs commands doesn't solve.
Moreover:
- If I disable https in launchSettings.json
"Docker": {"commandName": "Docker","launchBrowser": true,"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}","publishAllPorts": true,"useSSL": false <- }
then no problems (http obviously)
- If I create a brand new ASP.NET 5 Web App with HTTPS and Docker support in the same machine, F5 with Docker runs fine straight away (with https).
Can anyone suggest what the problem could be or how to troubleshoot it?