方法1: X509Certificate2 x509 = new X509Certificate2(strPathPfx, strPasswordPfx); 改为X509Certificate2 x509 = new X509Certificate2(strPathPfx.ToString(), strPasswordPfx.ToString(), X509KeyStorageFlags.MachineKeySet) 方法2: IIS应用池》高级设置 》修改加载用户配置文件 》True