错误 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

解决方案 »

  1.   

    第一个问题 调用不明就让它明确调用 把方法的全部名称写全(包括方法的所在类以及名称空间)另个问题,把JdSoft.Apns.Feedback重新编译一下试试,或者全部重新生成解决方案 或者重启机器 或者重启VS。。都尝试一遍
      

  2.   

    第1个问题System.Security.Cryptography.X509Certificates.X509Certificate2.X509Certificate2方法有重载
    方法第2个参数、 你看你要的是什么类型的(string和System.Security.SecureString)第2个问题是确实项目引用、 你项目中是否有JdSoft.Apns.Feedback这个类库? 生成1下、 将JdSoft.Apns.Feedback目录debug中的Dll放在你UI的Debug下...
      

  3.   

    第一个问题,将类,命名空间都写全了就行了。
    例如:System.String;
    第二个问题,没有找到dll文件,看一下路径是不是正确
      

  4.   

    第一个问题是第二个参数应该是string类型的,这个类型是否不明确第二个问题添加一下Feedback.dll这个引用
      

  5.   

    我的方法是这样的,这地方引用不明确,我应该怎么做呢?
    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;