从Visual Studio 2022〉工具〉Nuget包管理器〉包管理器控制台 当软件包管理器控制台显示在底部时,键入以下命令
PM > dotnet dev-certs https --clean
//Cleaning HTTPS development certificates from the machine. A prompt might get displayed to confirm the removal of some of the certificates.
//HTTPS development certificates successfully removed from the machine.
PM > dotnet dev-certs https -t
//Trusting the HTTPS development certificate was requested.A confirmation prompt will be displayed if the certificate was not previously trusted.Click yes on the prompt to trust the certificate.
//Successfully created and trusted a new HTTPS certificate.
PM > dotnet dev-certs https --check
//A valid certificate was found: C40087E6CA2F2A811F3BF78E3C5FE6BA8FA2XXXX - CN = localhost - Valid from 2023 - 01 - 27 23:21:10Z to 2024 - 01 - 27 23:21:10Z - IsHttpsDevelopmentCertificate: true - IsExportable: true
//Run the command with both--check and --trust options to ensure that the certificate is not only valid but also trusted.
2条答案
按热度按时间fjaof16o1#
我终于想通了。
对于遇到此问题的其他任何人,修复它的步骤是:
localhost
证书。可以在个人根目录和受信任根目录中找到这些证书\Users\[user]\AppData\Roaming\Microsoft\UserSecrets\
中dotnet dev-certs https --trust
以创建和安装一个新的,并提示信任在这之后它会再次工作。
ndasle7k2#
从Visual Studio 2022〉工具〉Nuget包管理器〉包管理器控制台
当软件包管理器控制台显示在底部时,键入以下命令