This page shows you how to configure Microsoft Visual Studio and create and deploy an ASP.NET application on Google Cloud Platform.
Before you begin
In the Cloud Platform Console, go to the Manage resources page and create a new project.
- Enable billing for your project.
- Make sure that you have the following software installed on your local system:
- Navigate to the ASP.NET Framework image on the Google Cloud Launcher.
Go to the ASP.NET Framework image
- Select Launch on Compute Engine.
- Choose your Deployment name and settings, ensuring that Allow HTTP Traffic and Allow WebDeploy Traffic are checked.
- Select Deploy.
Install Cloud Tools for Visual Studio
To install Cloud Tools for Visual Studio, complete one of the following installation processes:
- Navigate to Google Cloud Platform Extension for Visual Studio in the Visual Studio Gallery and follow the instructions to download and install the extension.
- Install the extension from the Extensions and Updates dialog in Visual
- Select Tools > Extensions and Updates.
- Select the Online tab from the left pane.
- Search for Google Cloud extension for Visual Studio.
- Click Download and follow the prompts.
- Restart Visual Studio for the new extension to be loaded.
Sign In to Google
Sign in to a Google account that you use to deploy your project to App Engine.
- Open Visual Studio.
- Launch Cloud Explorer by selecting Tools > Google Cloud Tools > Show Google Cloud Explorer.
- Add your Google account to access Google Cloud platform resources:
- Click Select or Create Account.
- Click Add account.
- A new browser window opens and asks for the permissions it needs to manage your App Engine applications.
- Select the account to use for your application.
- Click Allow and close the browser window.
Create an ASP.NET app
To create a new ASP.NET project and run it locally:
- Open Visual Studio.
- Choose File > New > Project to open the New Project dialog.
- Use the left panel to navigate to Installed > Visual C# > Google Cloud Platform.
- Select ASP.NET on Google Cloud Platform.
- Enter the Name of your project.
- Click OK.
- In the dialog, select the target framework for your project.
- Click Select Project to select the Google Cloud Project ID.
- Select a Feature.
- Click OK.
- Build the solution and run it locally, verifying that it works.
Deploy an ASP.NET app
To deploy your ASP.NET app to a Windows VM running on Compute Engine:
- In Google Cloud Explorer, select the newly created project and expand Google Compute Engine.
- Right-click on the VM instance that you created above with Cloud Launcher.
- Select Manage Windows credentials.
- Click Add credentials.
- Enter a username.
- Ensure that Create a password for me is selected and click Save.
- Click Reset when prompted with the confirmation question: "Reset the password for [your username] on the instance [instance you created]?"
- Then click the Close button to close the password window.
- Next click the Close button to close the Windows Credentials window.
- In the Visual Studio Solution Explorer pane, right click your application.
- In the context menu, click Publish to Google Cloud...
- In the Publish dialog box, choose Compute Engine.
- 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.