Learn MS NET | Visual Studio Docker Debugging failed: Failed to create the certificate

Our journey learning how to write .NET

Learn MS NET

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Visual Studio Docker Debugging failed: Failed to create the certificate

While working on one of my projects that had been working perfectly fine with HTTPS in Docker I had made some changes to the project file and removed a couple of entries one of which was the <UserSecretsId></UserSecretsId> from the file. I never thought much of it at the time. Later I wanted to run the project and I received the following dialog box.


I thought that was a strange dialog box to receive as I didn’t think that I had made any changes that would cause this issue to come up.

Upon doing a google search to see if I could come up with a resolution to the problem I came upon a bug report for a Docker issue that matched what I was having the issue with.

Adding the certificate to the Trusted Root Certificate store failed with the following error: Failed with a critical error.

It talked about some other possible resolutions to my issue I tried a few but still had the same issue. It also linked to another bug issue which was similar to what I was experiencing.

VS2017 Docker debugging failed: Failed to create the certificate

This more closely matched what I was experiencing and stated about it could be the <UserSecretsId></UserSecretsId> in the project file causing the issue. I placed that back in and my Docker containers started working again.

As an experiment I removed it and received a different error this time

   Message=Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found.
To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.

At which point I put back the <UserSecretsId></UserSecretsId> in my project file and continued working. I thought I would post this and hopefully help someone else having the same issue.

Comments are closed