Visual Studio 2017 gives 'Adding the Certificate to The Trusted Root Certificates store failed with the following Errror'

后端 未结 8 1815
抹茶落季
抹茶落季 2020-12-24 10:50

I am trying to run ASP MVC application with SSL mode set to true and whenever i run the application, i get prompt to trust the IIS Express SSL certificate. Upon clicking Yes

8条回答
  •  Happy的楠姐
    2020-12-24 11:33

    After having struggled with this issue now for a week (using Win 10 and Visual Studio 2019 Community Edition Version 16.1.1) and trying various solutions I found out the following:

    • by default the localhost certificate for IISExpress 10 gets installed in: Certificates (Local Computer) -> Personal

    • Repairing IISExpress 10 (Programs -> Programs and Features) will create a new localhost certificate also in: Certificates (Local Computer) -> Personal

    • Then export that certificate by saving it to a file using:

    Then import that certificate into: Certificates (Local Computer) -> Trusted Root Certification Authorities

    • then as user2988031 pointed out: delete the certificate from Certificates (Local Computer) -> Personal

    I also tried to use "dotnet dev-crts https --trust" but that did not work for me and always produced the following error:

    So to wrap it up: make shure there is only 1 localhost certificate which is in Certificates (Local Computer) -> Trusted Root Certification Authorities

    Update: I just realized that after modifying the web application a few times a different error manifested and I had to go through the whole process again in order to get it to work!

提交回复
热议问题