Google Cloud Platform Blog
Getting started with Google Cloud Client Libraries for .NET
Thursday, August 25, 2016
Posted by
Mete Atamel
, Developer Advocate
Last week,
we introduced new tools and client libraries
for .NET developers to integrate with
Google Cloud Platform
, including
Google Cloud Client Libraries for .NET
, a set of new client libraries that provide an idiomatic way for .NET developers to interact with GCP services. In this post, we'll explain what it takes to install the new client libraries for .NET in your project.
Currently, the new client libraries support a subset of GCP services, including
Google BigQuery
,
Google Cloud Pub/Sub
and
Google Cloud Storage
(for other services, you still need to rely on the older
Google API Client Libraries for .NET
). Both sets of libraries can coexist in your project and as more services are supported by the new libraries, dependencies on the older libraries will diminish.
Authentication
As you would expect, the new client libraries are published on
NuGet
, the popular package manager for .NET, so it's very easy to include them in your project. But before you can use them, you'll need to set up authentication.
The GitHub page for the libraries (
google-cloud-dotnet
) describes the process for each different scenario in the
authentication section
. Briefly, to authenticate for local development and testing, install
Cloud SDK for Windows
, which comes with Google Cloud SDK shell, and use the
gcloud
command line tool to authenticate.
If you haven’t initialized gcloud yet, run the following command in Google Cloud SDK shell to initialize your project, zones and also setup authentication along the way:
$ gcloud init
If you've already set up gcloud and simply want to authenticate, run this command instead:
$ gcloud auth login
Installation
Now, let's import and use the new libraries. Create a project in Visual Studio (but make sure it's not a .
NET Core
project, as those are not supported by the libraries yet), right click on the project references and select “Manage NuGet packages”:
In NuGet window, select “Browse” and also check “Include prerelease.” The full list of supported services and their NuGet package names can be found on the
google-cloud-dotnet
page. Let’s install the library for Cloud Storage. For Cloud Storage, we need to search for Google.Storage:
The resulting list shows the new client library for Cloud Storage (Google.Storage) along with the low-level library (Google.Apis.Storage) that it depends on. Select Google.Storage and install it. When installation is complete, you'll see Google.Storage as a reference, along with its Google.Apis dependencies:
That’s it! Now, you can use the new client library for Cloud Storage from your .NET application. If you're looking for a sample, check out the
Cloud Storage section
of the GitHub page for the libraries.
Give it a try and
let us know
what you think. Any issues?
Report them here
. Better yet, help us improve our support for .NET applications by
contributing
.
"Interested in helping us improve the Google Cloud User Experience? Click
here!
"
No comments :
Post a Comment
Don't Miss Next '17
Use promo code NEXT1720 to save $300 off general admission
REGISTER NOW
Free Trial
GCP Blogs
Big Data & Machine Learning
Kubernetes
GCP Japan Blog
Labels
Announcements
56
Big Data & Machine Learning
91
Compute
156
Containers & Kubernetes
36
CRE
7
Customers
90
Developer Tools & Insights
80
Events
34
Infrastructure
24
Management Tools
39
Networking
18
Open Source
105
Partners
63
Pricing
24
Security & Identity
23
Solutions
16
Stackdriver
19
Storage & Databases
111
Weekly Roundups
16
Archive
2017
Feb
Jan
2016
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2015
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2014
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2013
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2012
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2011
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2010
Dec
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2009
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Feed
Subscribe by email
Technical questions? Check us out on
Stack Overflow
.
Subscribe to
our monthly newsletter
.
Google
on
Follow @googlecloud
Follow
Follow
No comments :
Post a Comment