Setting up a .NET development environment
This tutorial shows how to prepare your local machine for
developing .NET
and
.NET core
apps that run on Trusted Cloud by S3NS and call
Trusted Cloud APIs.
Install a development environment
The recommended development environment for running the .NET tutorials and
sample apps in this documentation is
Visual Studio
or
Visual Studio Code.
Create a Trusted Cloud project
Create a Trusted Cloud project
to run your apps. Trusted Cloud projects form the basis for creating,
enabling, and using all Trusted Cloud services.
Set up authentication
Your .NET app must authenticate itself to use Trusted Cloud APIs. You use
Application Default Credentials (ADC),
which let you provide credentials for either local development or in a
production environment.
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider
(IdP), confirm that you have
signed in to the gcloud CLI with your federated identity.
For more information, see
Authenticate for using client libraries.
For general information about authentication, see
Authentication at Google.
Even though you can create and manage Trusted Cloud resources via your web
browser using the
Trusted Cloud console,
if you'd prefer to manage your Trusted Cloud resources from within
Visual Studio or from the command-line, you can consider installing the
following tools:
Google Cloud CLI:
The gcloud CLI is a command-line interface for Trusted Cloud
products and services.
Tools for Visual Studio:
Tools for Visual Studio enables development in Visual Studio on
Trusted Cloud.
Tools for PowerShell:
Tools for PowerShell is a set of cmdlets for Windows PowerShell
that lets you manage Trusted Cloud resources.
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis guide details the necessary steps to prepare your local environment for developing .NET and .NET Core applications that will interact with Google Cloud services.\u003c/p\u003e\n"],["\u003cp\u003eYou can use either Visual Studio or Visual Studio Code as your primary development environment for the tutorials and sample applications.\u003c/p\u003e\n"],["\u003cp\u003eA Google Cloud project is required as the foundation for utilizing all Google Cloud services, and can be created using the Google Cloud project creation resource.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication to Google Cloud APIs is managed through Application Default Credentials (ADC), which are adaptable for both local development and production environments.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, the Google Cloud CLI, Tools for Visual Studio, or Tools for PowerShell can be installed to manage Google Cloud resources directly from your development environment.\u003c/p\u003e\n"]]],[],null,["# Setting up a .NET development environment\n\nThis tutorial shows how to prepare your local machine for\ndeveloping [.NET](https://www.microsoft.com/net/)\nand\n[.NET core](https://www.microsoft.com/net/core/platform)\napps that run on Google Cloud and call\nGoogle Cloud APIs.\n\nInstall a development environment\n---------------------------------\n\nThe recommended development environment for running the .NET tutorials and\nsample apps in this documentation is\n[Visual Studio](https://www.visualstudio.com/)\nor\n[Visual Studio Code](https://code.visualstudio.com/).\n\nCreate a Google Cloud project\n-----------------------------\n\n[Create a Google Cloud project](/resource-manager/docs/creating-managing-projects)\nto run your apps. Google Cloud projects form the basis for creating,\nenabling, and using all Google Cloud services.\n\nSet up authentication\n---------------------\n\nYour .NET app must authenticate itself to use Google Cloud APIs. You use\n[Application Default Credentials (ADC)](/docs/authentication/application-default-credentials),\nwhich let you provide credentials for either local development or in a\nproduction environment.\n\n\nIf you're using a local shell, then create local authentication credentials for your user\naccount:\n\n```bash\ngcloud auth application-default login\n```\n\nYou don't need to do this if you're using Cloud Shell.\n\n\nIf an authentication error is returned, and you are using an external identity provider\n(IdP), confirm that you have\n[signed in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\nFor more information, see\n[Authenticate for using client libraries](/docs/authentication/client-libraries).\nFor general information about authentication, see\n[Authentication at Google](/docs/authentication).\n\n(Optional) Install .NET tools and SDKs\n--------------------------------------\n\nEven though you can create and manage Google Cloud resources via your web\nbrowser using the\n[Google Cloud console](http://console.cloud.google.com),\nif you'd prefer to manage your Google Cloud resources from within\nVisual Studio or from the command-line, you can consider installing the\nfollowing tools:\n\n- [Google Cloud CLI](/sdk):\n The gcloud CLI is a command-line interface for Google Cloud\n products and services.\n\n- [Tools for Visual Studio](/tools/visual-studio/docs):\n Tools for Visual Studio enables development in Visual Studio on\n Google Cloud.\n\n- [Tools for PowerShell](/tools/powershell/docs):\n Tools for PowerShell is a set of cmdlets for Windows PowerShell\n that lets you manage Google Cloud resources.\n\nWhat's next\n-----------\n\n- [Transcribe audio to text with Speech-to-Text API](/speech-to-text/docs/transcribe-client-libraries)\n- [Deploy a .NET Framework app to Compute Engine](/dotnet/docs/getting-started/hello-world)\n- [Deploy a .NET Core app to App Engine flexible environment](https://github.com/GoogleCloudPlatform/dotnet-docs-samples/tree/master/appengine/flexible)"]]