Search code examples
asp.netiiswindows-10iis-express

IIS Express trust self-signed SSL certificate pressed NO


I was trying to run for the first time my localhost from Visual Studio 2019 and Windows asked me:

enter image description here

I accidentally pressed NO, so now I can't see my site. I checked different suggestions offered here, in stack overflow, but didn't work.

I tried going to Add/Remove Programs and choosing the "Repair" option on IIS Express.

Also: cd C:\Program Files (x86)\IIS Express

IisExpressAdminCmd.exe setupsslUrl -url:urlToYourSite -UseSelfSigned

None of them worked.

Hope anyone can give me a hand.

Thanks.

Solved:

I have deleted both, IIS Express 10 and Visual Studio and reinstall and that fixed the issue.


Solution

  • I did a lot of tests to try to restore your problem, but all failed. Even if I click no every time like you do, it will still pop up the next time I run it again. When it finally no longer pops up, the application can still run, but with http instead of https. Fortunately, I finally reproduced your problem and found the following solution.

    1. In control panel->Uninstall or change a program, make IIS express repair. If repair doesn’t work. Just uninstall it and install it again.

    enter image description here

    1. Open Win+R ->enter %userprofile% -> Documents ->IIS Express, then delete all folders. Open your project in visual studio. Right click solution and clean it.

    enter image description here

    Both of these method worked while I tested. You can try them. If them still useless, please re-install visual studio.