Google API System.IO.FileLoadException

时间:2017-11-20 18:04:27

标签: c# asp.net google-api .net-assembly

我在尝试创建一个日历时遇到此错误:

Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我的bin中有Http.Primitves dll,而且我在web.config中有这样的引用:

 <dependentAssembly>
    <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" />
  </dependentAssembly>

它仍在寻找版本1.5以下是尝试在API中创建日历的代码:

 int iReturn;

    const string serviceAccountEmail = "Email.com";
    const string serviceAccountCertPath = @"C:\wwwroot\_CreateCalendarEvent.p12";
    const string serviceAccountCertPassword = "pass";
    const string userEmail = "email.com";
    var certificate = new X509Certificate2(serviceAccountCertPath, serviceAccountCertPassword, X509KeyStorageFlags.MachineKeySet |
                                 X509KeyStorageFlags.PersistKeySet |
                                 X509KeyStorageFlags.Exportable);
    ServiceAccountCredential credential = new ServiceAccountCredential(

   new ServiceAccountCredential.Initializer(serviceAccountEmail)

错误表示它在ServiceAccountCredential credential = new ServiceAccountCredential(处中断 如何更新此参考资料我使用Nuget从此问题更新并安装Google API Question

它仍然给我错误相同。

0 个答案:

没有答案