0

My problem is that when launching the ASP.NET Core 6 application through the windows service, I get the following error:

System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.

But when you run the program from the .exe, everything is fine, that is, there is no problem with the certificate.

How can I fix this problem?

1 Answer 1

0
  1. Run certmgr.msc and delete all localhost certificates (dotnet dev-certs https –clean) under Personal\Certificates and Trusted Root Certification Authorities\Certificates.

  2. Create and trust a new development certificate dotnet dev-certs https --trust

  3. Restart the application to try if it solves the problem

For more information, please refer to this link.

But when you run the program from the .exe, everything is fine, that is, there is no problem with the certificate

This may be because when running through Windows Service, the program runs as the service account, which may not have permission to access or trust the developer certificate.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer, but this didn't work for me. How can I give a permission to access the developer certificate? There is the thing, that I created a default project on ASP.NET 6.0, added settings for the windows service and it works great, but my main app doesn't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.