[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["Deploy an ASP.NET app by using Tools for Visual Studio This page shows you how to configure Microsoft Visual Studio and create and\ndeploy an ASP.NET application on Google Cloud.\n\nBefore you begin\n\n1. In the Google Cloud console, on the project selector page,\n click **Create project** to begin creating a new\n Google Cloud project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n2.\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n3. Make sure that you have the following software installed on your local system:\n - [Visual Studio 2022](https://www.visualstudio.com/vs/), [Visual Studio 2019, or Visual Studio 2017](https://www.visualstudio.com/vs/older-downloads/), any Windows edition. Cloud Tools for Visual Studio doesn't support Visual Studio 2017 for Mac.\n - [gcloud CLI](/sdk/docs/install)\n4. Create a new Windows VM to host your app:\n 1. Navigate to the ASP.NET Framework image on the Google Cloud Marketplace. \n [Go to the ASP.NET Framework image](https://console.cloud.google.com/marketplace/details/click-to-deploy-images/aspnet)\n 2. Select **Launch on Compute Engine**.\n 3. Choose your **Deployment name** and settings, ensuring that **Allow HTTP Traffic** and **Allow WebDeploy Traffic** are checked.\n 4. Select **Deploy**.\n\nInstalling Cloud Tools for Visual Studio\n\nTo install Cloud Tools for Visual Studio from the **Extensions and Updates** dialog in\nVisual Studio:\n\n1. Select **Tools** \\\u003e **Extensions and Updates**.\n2. Select the **Online** facet from the left pane.\n3. Search for **Google Cloud Tools for Visual Studio**.\n4. Click **Download** and follow the prompts.\n5. Restart Visual Studio to load the extension.\n\nSigning in to Google\n\nSign in to a Google account that you use to deploy your project to\nApp Engine.\n\n1. Open Visual Studio.\n2. Launch **Cloud Explorer** by selecting **Tools** \\\u003e **Google Cloud Tools** \\\u003e **Show Google Cloud Explorer**.\n3. Click **Select or create account**.\n4. Click **Add account**.\n5. A new browser window opens and asks for the permissions it needs to manage your Google Cloud resources.\n6. Select the account to use for your application.\n7. Click **Allow** and close the browser window.\n\n\u003cbr /\u003e\n\nSelecting a project\n\nTo select a Google Cloud project to deploy your application to:\n\n1. In the **Cloud Explorer** , click **Select Project**.\n2. Select your project in the list.\n3. Click **OK**.\n\nThe Cloud Explorer refreshes and displays the resources for the selected\nproject.\n\nCreating an ASP.NET app\n\nTo create a new ASP.NET project and run it locally:\n\n1. Choose **File** \\\u003e **New** \\\u003e **Project** to open the New Project dialog.\n2. Use the left panel to navigate to **Installed** \\\u003e **Visual C#** \\\u003e **Google Cloud Platform**.\n3. Select **ASP.NET on Google Cloud Platform**.\n4. 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.\n5. Enter the **Name** of your project.\n6. Click **OK**.\n7. Select the **Template type**.\n8. Click **OK**.\n9. Build the solution and run it locally, verifying that it works.\n\nDeploying an ASP.NET app\n\nTo deploy your ASP.NET app to a Windows VM running on Compute Engine:\n\n1. In Cloud Explorer, select the newly created project and expand GKE.\n2. Right-click on the VM instance that you created above with Cloud Marketplace.\n3. Select **Manage Windows credentials**.\n4. Click **Add credentials**.\n5. Enter a username.\n6. Ensure that **Create a password for me** is selected and click **Save**.\n7. Click **Reset** when prompted with the confirmation question: \"Reset the password for \\[your username\\] on the instance \\[instance you created\\]?\"\n8. Then click the **Close** button to close the password window.\n9. Next click the **Close** button to close the **Windows\n Credentials** window.\n10. In the Visual Studio **Solution Explorer** pane, right click your application.\n11. In the context menu, click **Publish to Google Cloud**\n12. In the Publish dialog box, choose **Compute Engine**.\n13. Click **Publish** to build and deploy the sample application. After publishing completes, Visual Studio opens the application in your default web browser:\n\nThat's it --- your application is hosted on Compute Engine.\n\nWhat's next\n\n- Learn more about [Browsing Compute Engine Resources](/tools/visual-studio/docs/browse-compute)."]]