Deploy an ASP.NET app by using Tools for Visual Studio

This page shows you how to configure Microsoft Visual Studio and create and deploy an ASP.NET application on Google Cloud.

Before you begin

  1. In the Google Cloud console, on the project selector page, click Create project to begin creating a new Google Cloud project.

    Go to project selector

  2. Make sure that billing is enabled for your Google Cloud project.

  3. Make sure that you have the following software installed on your local system:
  4. Create a new Windows VM to host your app:
    1. Navigate to the ASP.NET Framework image on the Google Cloud Marketplace.
      Go to the ASP.NET Framework image
    2. Select Launch on Compute Engine.
    3. Choose your Deployment name and settings, ensuring that Allow HTTP Traffic and Allow WebDeploy Traffic are checked.
    4. Select Deploy.

Installing Cloud Tools for Visual Studio

To install Cloud Tools for Visual Studio from the Extensions and Updates dialog in Visual Studio:

  1. Select Tools > Extensions and Updates.
  2. Select the Online facet from the left pane.
  3. Search for Google Cloud Tools for Visual Studio.
  4. Click Download and follow the prompts.
  5. Restart Visual Studio to load the extension.

Signing in to Google

Sign in to a Google account that you use to deploy your project to App Engine.

  1. Open Visual Studio.
  2. Launch Cloud Explorer by selecting Tools > Google Cloud Tools > Show Google Cloud Explorer.
  3. Click Select or create account.
  4. Click Add account.
  5. A new browser window opens and asks for the permissions it needs to manage your Google Cloud resources.

  6. Select the account to use for your application.
  7. Click Allow and close the browser window.

Selecting a project

To select a Google Cloud project to deploy your application to:

  1. In the Cloud Explorer, click Select Project.
  2. Select your project in the list.
  3. Click OK.

The Cloud Explorer refreshes and displays the resources for the selected project.

Creating an ASP.NET app

To create a new ASP.NET project and run it locally:

  1. Choose File > New > Project to open the New Project dialog.
  2. Use the left panel to navigate to Installed > Visual C# > Google Cloud Platform.
  3. Select ASP.NET on Google Cloud Platform.
  4. To deploy your app to a VM on Compute Engine, target the .NET Framework, not .NET Core. Use the ASP.NET Core on Google Cloud Platform template for GKE or App Engine.

  5. Enter the Name of your project.
  6. Click OK.
  7. Select the Template type.
  8. Click OK.
  9. Build the solution and run it locally, verifying that it works.

Deploying an ASP.NET app

To deploy your ASP.NET app to a Windows VM running on Compute Engine:

  1. In Cloud Explorer, select the newly created project and expand GKE.
  2. Right-click on the VM instance that you created above with Cloud Marketplace.
  3. Select Manage Windows credentials.
  4. Click Add credentials.
  5. Enter a username.
  6. Ensure that Create a password for me is selected and click Save.
  7. Click Reset when prompted with the confirmation question: "Reset the password for [your username] on the instance [instance you created]?"
  8. Then click the Close button to close the password window.
  9. Next click the Close button to close the Windows Credentials window.
  10. In the Visual Studio Solution Explorer pane, right click your application.
  11. In the context menu, click Publish to Google Cloud
  12. In the Publish dialog box, choose Compute Engine.
  13. Click Publish to build and deploy the sample application. After publishing completes, Visual Studio opens the application in your default web browser:

That's it — your application is hosted on Compute Engine.

What's next