错误 1 在以下方法或属性之间的调用不明确:“System.Security.Cryptography.X509Certificates.X509Certificate2.X509Certificate2(byte[], string, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)”和“System.Security.Cryptography.X509Certificates.X509Certificate2.X509Certificate2(byte[], System.Security.SecureString, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags)” C:\Users\Lenovo\Desktop\Redth-APNS-Sharp-8731bf4\JdSoft.Apple.Apns.Feedback\FeedbackService.cs 90 27 JdSoft.Apple.Apns.Feedback错误 3 未能找到元数据文件“C:\Users\Lenovo\Desktop\Redth-APNS-Sharp-8731bf4\JdSoft.Apple.Apns.Feedback\bin\Debug\JdSoft.Apns.Feedback.dll” JdSoft.Apple.Apns.Feedback.Test
方法第2个参数、 你看你要的是什么类型的(string和System.Security.SecureString)第2个问题是确实项目引用、 你项目中是否有JdSoft.Apns.Feedback这个类库? 生成1下、 将JdSoft.Apns.Feedback目录debug中的Dll放在你UI的Debug下...
例如:System.String;
第二个问题,没有找到dll文件,看一下路径是不是正确
certificate = new X509Certificate2(p12FileBytes, null, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
他的定义类似于是这样的:
namespace System.Security.Cryptography.X509Certificates
{
public class X509Certificate2 : X509Certificate
{
public X509Certificate2();
System.Security.Cryptography.X509Certificates.X509Certificate2
public X509Certificate2(byte[] rawData);引用是这样:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Net;
using System.Net.Sockets;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;