0
votes

I'm getting the following exception when trying to use the Google Auth API:

System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. ----> System.IO.FileNotFoundException : 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 system cannot find the file specified.

The exception happens in Google.Api.Core.dll.

If I check the /Bin folder I can see Sytem.Net.Http.Primitives.dll in there and the version is 4.2.28.0.

I have tried updating the Microsoft HTTP Client Libraries NuGet package but that didn't help.

Is the problem something to do with a mismatch of .dll versions? If so how can I resolve that? Or is it something else entirely?

1

1 Answers

0
votes

Double check if the assembly file is there in the bin folder and if its there, then try removing the reference and again add it to your project.

The version should be the same as expected. Also check on your web.config too for what it has about this particular assembly.

In your error code, I can see two different versions for the same file. Means probably, you are getting a clash between the existing assembly and the referenced assembly. Check you web.config for which version is referenced there and make sure you have the same version added to your project.

This link might help :

Could not find assembly System.Net.Http.Primitives