Home > Net >  Where to find proper documentation for Google.GData.Spreadsheets nuget package?
Where to find proper documentation for Google.GData.Spreadsheets nuget package?

Time:09-18

So, there is an application X, I am currently fixing, written by using .Net Framerwork v4.5 and Google.GData.Spreadsheets nuget package, which retrieves rows and columns from certain Google Spreadsheet.

Google during last month(2021 August) has officially shut down v3 spreadsheets API, which caused X to stop working.

X is a legacy app, which was written by employee who isn't working in my company for now, with mostly legacy code. Some parts of using old Spreadsheets package I can neither understand or properly debug. I would really like to find at least a documentation for that old package, so I could possibly understand what's going on. I mostly don't have problems with new api, because there is a guide how to migrate from v3 to v4, so I can see which OAuth2.0 consent scopes are changed etc. But for some reason, I struggle to find any documentation for Google.GData.Spreadsheets (at least on nuget.org and code.google.com there is no useful, usable for me info).

  • Did anybody work with Google.GData.Spreadsheets package, and if so, were did you find documentation?
  • Can somebody give me at least general directional advice in this situation?
  • I didn't work with .net platform for last 7 months, so there might be some issues in my general methodology for solving this kind of a problem.

CodePudding user response:

Did anybody work with Google.GData.Spreadsheets package, and if so, were did you find documentation?

No and you wont the Gdata version of the Google sheets api is obsolete and completely different from Google Sheets api v4 there is no way you are going to get it to work.

Can somebody give me at least general directional advice in this situation?

You will need to switch to the Google Sheets api v4 there is a sample on the offical documentation for use with .net Google sheets api sample This sample uses the Google api .net client library

the library for .net is the Google api .net client library

Authorization should be something like this for a console app.

using (var stream = new FileStream(clientSecretJson, FileMode.Open, FileAccess.Read))
                {
                    string credPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                    credPath = Path.Combine(credPath, ".credentials/", System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);

                    // Requesting Authentication or loading previously stored authentication for userName
                    var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets,
                                                                             scopes,
                                                                             userName,
                                                                             CancellationToken.None,
                                                                             new FileDataStore(credPath, true)).Result;

                    credential.GetAccessTokenForRequestAsync();
                    return credential;
                }

Again this api is completely different then gdata which means you will need to change all of the calls your application is making to the api to use the new v4 version. I would personally expect this to be a full rewrite i did an upgrade on an app like yours about eight years ago. Gdata is completely different keep nothing start over.

I didn't work with .net platform for last 7 months, so there might be some issues in my general methodology for solving this kind of a problem.

  • Support for .NET Framework 4, 4.5, and 4.5.1 ended on January 12, 2016.
  • Support for .NET Framework 4.5.2, 4.6, and 4.6.1 will end on April 26, 2022.

You might as well upgrade to .net 5 while you are at it.

Documentation

As for finding the old documentation I'm afraid its gone. I cant find the source code on Github anymore nor can I find the documentation itself. Google announced that the API was going away more then a year ago, your a little late.

  • Related