C# Google Drive API References - c#

I'm trying to connect to Google Drive with its API. Google states that it provides the necessary DLLs and references at this link here ("Download the latest version of the library"). However, when I try to add the necessary reference(s), C# is unable to find any DLLs and a manual search for them yields 0 results. From the referenced link:
The ZIP file contains the core library and Drive-specific DLLs.
Referencing these DLLs in your solution is discussed in the next
section.
The following namespaces need references:
using DotNetOpenAuth.OAuth2;
using Google.Apis.Authentication.OAuth2;
using Google.Apis.Authentication.OAuth2.DotNetOpenAuth;
using Google.Apis.Drive.v2;
using Google.Apis.Drive.v2.Data;
using Google.Apis.Util;
using Google.Apis.Services;
In looking around on the Google link, I don't find anything with the necessary DLLs that are referenced in the above.
Note: this is a test desktop console app, not a web application.
Edit: I should add, if I add the below files as Existing Items, it still is unable to find most of the assemblies:
Google.Apis.Drive.v2.1.5.0.95-beta.nuspec
Google.Apis.Drive.v2.cs
Google.Apis.Drive.v2.csproj
packages.config
using DotNetOpenAuth.OAuth2;
using Google.Apis.Authentication.OAuth2;
using Google.Apis.Authentication.OAuth2.DotNetOpenAuth;
using Google.Apis.Util;
using Google.Apis.Services;

You can download the API and it's dependencies via Nuget.org if you want them precompiled. The Nuget version is only slightly out-of-date however, if you want the newest version you will have to download the source and build it.
I'd say go with the Nuget version for simplicity.
Google Drive API on Nuget.org

Related

Unable to find Windows.ApplicationModel

Hi I am trying to use the Windows.ApplicationModel as in this example
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Package
However I am unable to import the dll.
using Windows.ApplicationModel;
results in an error although I am using .NET Version where it should exist. Also I cannot find it when I try to add the reference.
Any Ideas?
I need it to get some packe Informations about Programs that run in the ApplicationFrameHost.
From what I can tell, you need the Windows SDK 17134 version that comes with the UWP development package in the installer. Then you can use that namespace. Google also led me to this link which might help: https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/

Unicode.Net failed to install library

I simply want to install Unicode.NET library, what do i do wrong?
(I'm using VS Community 2017, V:15.3.4)
This library is an emoji and text-processing library for .NET. They are using Assert from xUnit library. Take a look at their source code from github. inside the tests folder.
Read more here
You need to install the NUnit-test framework as well. The red underlined code is a hint that the compiler cannot resolve the assert-function used in your code, which is part of the NUnit-framework.
Just look for enter link description here
So get the package, add the reference to your project and don't forget the using directive:
using NUnit.Framework;

Error while attempting to use "using com.google.zxing;" to decode Data Matrix

I started off from the thread to [decode data matrix in C#] (How To Use ZXing C# Port)! but I am encountering an error that prevents me from using zxing.
error states: "The type or namespace name 'com' could not be found (are you missing a using directive or an assembly reference?)"
In my code i am (trying to) use:
using com.google.zxing;
Please let me know what I am doing wrong.
It'd be nice if C# could automatically detect the references you're using and download them, but this is not the case. You need to download the ZXing SDK and reference it before using it.
The easiest way to do so is via NuGet, which is built in Visual Studio from 2012 onwards, and available for VS 2010. Right-click on your project, click on "Manage NuGet Packages", then select "Online" from the left-hand menu and search with the search box in the top right.
There are two ZXing ports available on NuGet, so you'll have to look at them both and pick the one that seems right for you.
You can also find some ZXing DLL on the Internet and reference it from your project: right-click on your project's "References", click on "Add reference..." then on the "Browse" button.
However, that is not as convenient as NuGet because you need to manually check for updates to the library, and update the DLL, whereas NuGet will tell you when an update is available (it won't force you to update).
Just by looking at your code sample, I wouldn't suggest using a port that uses Java-like namespaces (a more C#-y version would be e.g. "Google.ZXing"), since it sounds like a "dumb" port that simply converted the Java syntax to C# without thinking about whether some C# features are better at doing whatever the original library wanted to do.
I've used ZXing.Net v0.14 in a Windows Phone app and it works well.
You have to replace
using com.google.zxing;
with
using ZXing;
if you are referencing and using the ZXing.Net assemblies.
I replaced the Java-stylish namespaces with a more .Net like version.
Old sample around the web doesn't work with ZXing.Net.
In the source code repository and the download section of ZXing.Net you will
find some more up-to-date samples. You should really start with the newer samples because I wrote some simplifications on top of the port.

Configuring ImageResizing.Net Programmatically

I'm using ImageResizing.Net within a class library as part of a back-end which requires bypassing Web.Config/App.Config by installing plugins in code like so:
ImageResizer.Configuration.Config.Current.Plugins.Install(new ImageResizer.Plugins.SimpleFilters.SimpleFilters());
ImageResizer.Configuration.Config.Current.Plugins.Install(new ImageResizer.Plugins.AdvancedFilters.AdvancedFilters());
I've verified that plugins are loaded within:
ImageResizer.Configuration.Config.Current.Plugins
I'm getting the following error when imageJob.Build(); is called:
Could not load file or assembly 'AForge.Imaging, Version=2.2.5.0, Culture=neutral, PublicKeyToken=ba8ddea9676ca48b' or one of its dependencies. The system cannot find the file specified.
Hoping this could be solved by referencing the libraries directly I've added the following using statements to the top of the class that uses ImageResizer:
using AForge;
using AForge.Imaging;
using AForge.Imaging.Filters;
using AForge.Imaging.ColorReduction;
using AForge.Imaging.ComplexFilters;
using AForge.Imaging.Textures;
Am still getting the same error. I've verified that the AForge references exist in my project, are the correct version and have "Copy Local" set to "True". These references were part of the dependencies that were automatically installed with the Nuget Packages for ImageResizing & the associated plugins.
UPDATE
I've decided to move the image processing over to a web api since the library was not designed for this scenario. This is called out by the author of the library in the comments of this S.O. question . I will mark this as the answer.
I've decided to move the image processing over to a web api since the library was not designed for this scenario. This is called out by the author of the library in the comments of this S.O. question

How to use youtube-api ver 3 sample files of .net?

I need to develop web application which use youtube api v3 for searching videolist by channel name and author name.
for simple testing
go to youtube api client site
then download sample files of .net.
I downloaded youtube/yt-samples-dotnet from here.
Here i got 4 class files.
no sln.
Then what to do? i mean just open it and run!!!? or something else needed from my side coding?
I already create account and Generate API key.
UPDATE
Now i create new project 3 tier with BAL DAL PAL
In BAL : i added all 4 .cs files
then add reference which is download from here.
I need :
using DotNetOpenAuth.OAuth2;
using Google.Apis.Youtube.v3;
using Google.Apis.Youtube.v3.Data;
then what to do?
As explained in the comment at the top of those files, there are dependencies on the Google APIs Client Library for .NET. You can follow the user guide for getting started, and I'd recommend using the NuGet approach to pulling in the dependent libraries.
Here: https://developers.google.com/api-client-library/dotnet/apis/youtube/v3
Then you can download the library opening the nuget webpage and viewing the package id and the version.
https://www.nuget.org/packages?q=Google.Apis.youtube&prerelease=true&sortOrder=relevance
and then build this url:
https://www.nuget.org/api/v2/package/{packageID}/{packageVersion}
=>
https://www.nuget.org/packages/Google.Apis.YouTube.v3/1.7.0.94-beta

Categories