You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 11下Localhost证书导入TRCA后立即消失问题求助

Windows 11下ASP.NET自签名开发证书导入TRCA后自动消失问题

在Windows 11系统上开发ASP.NET应用时,测试所需的自签名开发证书始终无法保留在**Trusted Root Certification Authorities(TRCA)**文件夹中——刚导入后快速刷新能看到该证书,但1-2秒后就会消失。

已尝试的操作

  • 以管理员/普通用户身份执行dotnet dev-certs相关命令(命令日志见下文)
  • 通过certmgr复制粘贴证书,使用certutil、netsh、makecert及New-SelfSignedCertificate等工具手动创建、导出并导入证书
  • 删除Roaming/ASP.NET/https、Local/ASP.NET/DataProtection-Keys文件夹及所有机密文件
  • 修复、卸载重装IIS Express,多次卸载重装修复不同版本的Visual Studio与VS Code

命令行操作日志

C:\Windows\System32>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.

C:\Windows\System32>dotnet dev-certs https
The HTTPS developer certificate was generated successfully.

C:\Windows\System32>dotnet dev-certs https --trust
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 trusted the existing HTTPS certificate.

C:\Windows\System32>dotnet dev-certs https --check --trust
The following certificates were found, but none of them is trusted: 1 certificate
    1) 8AC3C820AF03BC63F05179ED5762728BB38F171A - CN=localhost - Valid from 2024-06-04 13:19:17Z to 2025-06-04 13:19:17Z - IsHttpsDevelopmentCertificate: true - IsExportable: true

疑问

该电脑已加入Active Directory,是否可能是**组策略(GPO)**导致证书被自动删除?

安全组策略汇总


内容的提问来源于stack exchange,提问作者Thor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 21:25:05