在我本机执行没问题,放在服务器上就出现错误了
Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: 出现了内部错误。\r\n at System.Security.Cryptography.CngKey.Import(ReadOnlySpan`1 keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)\r\n at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)\r\n at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format, CngProvider provider)\r\n at System.Security.Cryptography.CngKey.Import(Byte[] keyBlob, CngKeyBlobFormat format)\r\n at ArabMath.Service.HttpHandler.Sign(String message) in D:\\ArabMath\\ArabMathCore\\ArabMath.Service\\WxService\\WxPayService.cs:line 193\r\n at ArabMath.Service.HttpHandler.BuildAuthAsync(HttpRequestMessage request) in D:\\ArabMath\\ArabMathCore\\ArabMath.Service\\WxService\\WxPayService.cs:line 185\r\n at ArabMath.Service.HttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in D:\\ArabMath\\ArabMathCore\\ArabMath.Service\\WxService\\WxPayService.cs:line 164\r\n at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)\r\n at ArabMath.Service.WxPayService.WxPrePayAsync(Int32 total) in D:\\ArabMath\\ArabMathCore\\ArabMath.Service\\WxService\\WxPayService.cs:line 92",
一个高人说,需要在服务器上执行安装这个apiclient_cert.p12,我也安装了呀。
到底是啥问题,很急呀,感谢~~
谢谢你,搞定了。IIS的一个配置问题。https://developers.weixin.qq.com/community/develop/article/doc/000440f48384082878cbb48fd51413,虽然和这个错误不一样,但是也解决了。谢谢呀。