Publish a Web app to a web site using Visual Studio

You can use the Publish tool to publish ASP.NET, ASP.NET Core, .NET Core, and Python apps to a website from Visual Studio. For Node.js, the steps are supported but the user interface is different.

Prerequisites

  • Visual Studio 2019 installed with the appropriate workloads for your language of choice:
    • ASP.NET: ASP.NET and web development
    • Python: Python development
    • Node.js: Node.js development
  • Visual Studio 2017 installed with the appropriate workloads for your language of choice:
    • ASP.NET: ASP.NET and web development
    • Python: Python development
    • Node.js: Node.js development
  • An ASP.NET, ASP.NET Core, Python, or Node.js project. If you don't already have a project, select an option below:

    • ASP.NET Core: Follow Quickstart: Use Visual Studio to create your first ASP.NET Core web app, or use the following steps:

      In Visual Studio 2019, choose Create a new project in the start window. If the start window is not open, choose File > Start Window. Type web app in the search box, choose C# as the language, then choose ASP.NET Core Web Application (Model-View-Controller), and then choose Next. On the next screen, name the project MyASPApp, and then choose Next.

      Choose either the recommended target framework (.NET Core 3.1) or .NET 5, and then choose Create.

      In Visual Studio 2017, choose File > New Project, select Visual C# > .NET Core, then select ASP.NET Core Web Application. When prompted, select the Web Application (Model-View-Controller) template, make sure that No Authentication is selected, and then select OK.

    • Python: Follow Quickstart: Create your first Python web app using Visual Studio, or use File > New Project, select Python, then select Flask Web Project.

    • Node.js: Follow Quickstart: Use Visual Studio to create your first Node.js app, or use File > New Project, select JavaScript, then select Blank Node.js Web Application.

  • Make sure you build the project using the Build > Build Solution menu command before following the deployment steps.

Note

If you need to publish a Windows desktop application to a network file share, see Deploy a desktop app using ClickOnce (C# or Visual Basic). For C++/CLR, see Deploy a native app using ClickOnce or, for C/C++, see Deploy a native app using a Setup project.

Publish to a Web site

  1. In Solution Explorer, right-click the project and choose Publish (or use the Build > Publish menu item).

    The Publish command on the project context menu in Solution Explorer

  2. If you have previously configured any publishing profiles, the Publish pane appears. Select New.

  3. In the Publish window, choose Web Server (IIS).

    Choose publish target

  4. Choose Web Deploy as the deployment method. Web Deploy simplifies deployment of Web applications and Web sites to IIS servers, and must be installed as an application on the server. Use the Web platform installer to install it.

    Choose deployment method

  5. Configure the required settings for the publish method and select Finish.

    Web Deploy connection details

  6. To publish, select Publish in the summary page. The Output window shows deployment progress and results.

    If you need help troubleshooting ASP.NET Core on IIS, see Troubleshoot ASP.NET Core on Azure App Service and IIS.

Next steps

In this quickstart, you learned how to use Visual Studio to create a publishing profile. You can also configure a publishing profile by importing publish settings.