How to login to Google API with Service Account in C# – Invalid Credentials

It appears that the GoogleAnalytics cannot consume a generic GoogleCredential and interpret it as a ServiceAccountCredential (even though it is acknowledged, interally, that it is actually of that type). Thus you have to create a ServiceAccountCredential the hard way. It’s also unfortunate that GoogleCredential does not expose the various properties of the credential, so I … Read more

Could not load file or assembly System.Net.Http.Primitives. Located assembly’s manifest definition does not match the assembly reference

I ran into the same issue with the Google API’s. The main issue here is if you install the Microsoft Http Client Libraries it puts in your project an updated version of the System.Net.Http.Primitives DLL. The web.config assumes you are still using the default version of 1.5. There are two things that need to happen … Read more

Accessing Google Spreadsheets with C# using Google Data API

According to the .NET user guide: Download the .NET client library: Add these using statements: using Google.GData.Client; using Google.GData.Extensions; using Google.GData.Spreadsheets; Authenticate: SpreadsheetsService myService = new SpreadsheetsService(“exampleCo-exampleApp-1”); myService.setUserCredentials(“jo@gmail.com”, “mypassword”); Get a list of spreadsheets: SpreadsheetQuery query = new SpreadsheetQuery(); SpreadsheetFeed feed = myService.Query(query); Console.WriteLine(“Your spreadsheets: “); foreach (SpreadsheetEntry entry in feed.Entries) { Console.WriteLine(entry.Title.Text); } Given … Read more

tech