.NET ON GOOGLE CLOUD PLATFORM

Try It Free View Documentation

Build, Deploy, Debug, and Monitor Highly Scalable .NET Apps

  • Build .NET apps using Visual Studio, browser based command-line, or Windows PowerShell
  • Use GCP services through idiomatic .NET libraries
  • Query fully managed SQL databases using C#
  • Scale .NET Core apps using Google’s technology
  • Launch pre-configured ASP.NET Windows Servers
  • Deploy ASP.NET Core apps as Docker container
A Broad Set Of Idiomatic .NET Libraries

Take advantage of popular libraries in C# to access Google Cloud Platform services

1
Install the client library using NuGet Package Manager, .NET CLI, or Paket CLI
PM> Install-Package Google.Cloud.Storage.V1 -Version 2.1.0-beta01
.NET CLI> dotnet add package Google.Cloud.Storage.V1 --version 2.1.0-beta01
Paket CLI> paket add Google.Cloud.Storage.V1 --version 2.1.0-beta01
2
Set up a Cloud Platform Console project
  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. Set up a Cloud Console project.

    Set up a project

    Click to:

    • Create or select a project.
    • Enable the Cloud Storage API for that project.
    • Create a service account.
    • Download a private key as JSON.

    You can view and manage these resources at any time in the Cloud Console.

3
Write your code

using Google.Cloud.Storage.V1;
using System;
using System.Diagnostics;

namespace GoogleCloudSamples
{
    class StorageQuickstart
    {
        static void Main(string[] args)
        {
            // Your Google Cloud Platform project ID.
            string projectId = "YOUR-PROJECT-ID";


            // Instantiates a client.
            using (StorageClient storageClient = StorageClient.Create())
            {
                // The name for the new bucket.
                string bucketName = projectId + "-test-bucket";
                try
                {
                    // Creates the new bucket.
                    storageClient.CreateBucket(projectId, bucketName);
                    Console.WriteLine($"Bucket {bucketName} created.");
                }
                catch (Google.GoogleApiException e)
                when (e.Error.Code == 409)
                {
                    // The bucket already exists.  That's fine.
                    Console.WriteLine(e.Error.Message);
                }
            }
        }
    }
}
.NET QUICK STARTS
Find and Fix Production Issues

Google Cloud operations products provide powerful logging, monitoring, and reporting capabilities. It equips you with insights into the health, performance, and availability of cloud-powered applications, enabling you to find and fix issues production faster.

Learn more
.NET ON GCP COMMUNITIES

Got something to say? Join our community to ask questions, or just chat with the experts at Google who help build the support for .NET on Google Cloud Platform.