kelvinRosa / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

System.IO.FileLoadException: Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0 #518

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I used the latest version of Google Calendar API from Nuget and i am getting 
this error when running my program. I am using .net c#

Adding the following to my .config file and it does not help
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" />
    <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="1.5.0.0" newVersion="4.2.28.0" />
    </dependentAssembly>
  </runtime>
  <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup>

I have checked out solutions on the internet and some people added the above to 
.config file and resolve their issues but not in my case.

Please advise

System.IO.FileLoadException: 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)
File name: 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'
   at Google.Apis.Http.HttpClientFactory.CreateHandler(CreateHttpClientArgs args)
   at Google.Apis.Http.HttpClientFactory.CreateHttpClient(CreateHttpClientArgs args)
   at Google.Apis.Auth.OAuth2.ServiceAccountCredential..ctor(Initializer initializer)

Original issue reported on code.google.com by vinguyen...@gmail.com on 8 Dec 2014 at 2:58

GoogleCodeExporter commented 9 years ago
Take a look in:
http://stackoverflow.com/questions/18370360/could-not-load-file-or-assembly-syst
em-net-http-primitives-located-assemblys-m
and
http://stackoverflow.com/questions/21057052/asp-net-app-crashes-could-not-load-f
ile-or-assembly-microsoft-threading-tasks/21343949#21343949

They had similar issues.

I'm closing this issue for now, if it still happens, please feel free to open a 
new stack overflow issue.
THANKS!

Original comment by pele...@google.com on 10 Dec 2014 at 4:13