React with ASP.NET Core

Publish a React front end together with an ASP.NET Core back end.

The React and ASP.NET Core template in Visual Studio creates a React front end and an ASP.NET Core back end in one solution. Both parts are published together to a single website — you only have to publish the right project.

Before you start

Create the project

  1. Choose the template

    In Visual Studio create a new project, select React and ASP.NET Core and click Next.

  2. Finish the wizard

    On the Additional information page leave the default settings and click Create.

The template creates two projects: a client project (React) and a server project (ASP.NET Core).

Important

Always build and publish the server project. It includes the client application in its output.

Publish

  1. Download the publish profile

    In the Control Panel open your website, choose Deploy, switch WebDeploy to Enabled on the Visual Studio access card and click Download publish profile. Save the .publishSettings file.

  2. Build the server project

    In Solution Explorer right-click the server project and choose Rebuild.

  3. Import the profile

    Right-click the server project again and choose Publish. Click Import profile and select the .publishSettings file.

  4. Publish

    Click Publish. Visual Studio publishes the application to your website.

When the publish finishes, open the website in your browser. The React application loads and calls the ASP.NET Core back end on the same address.

Something went wrong?

Still stuck? Our support team is happy to help.
Ask the community Open a support ticket