⚛ React + ASP.NET Core Guide

4. Run and debug

Start both halves with one keypress, then debug C# and JavaScript together.

Start the app

Select the https launch profile for the server project and press F5. Two console windows open:

The browser opens on the Vite URL. Edit a React file, save, and the page updates without a full reload.

The https launch profile is currently required by the template. If you start with the plain http profile, the front end and proxy may not connect.

Run from the command line

dotnet run --project ReactWithAspNet.Server --launch-profile https

Stop the browser opening on the API URL

By default Visual Studio may open the server's own URL (often showing raw JSON). In the server project's Properties → Debug → Open debug launch profiles UI, clear Launch browser for the https profile so only the Vite URL opens.

Debugging

Managing npm packages

Front-end tests

The JavaScript project system can discover tests written for frameworks such as Jest or Vitest and show them in Test Explorer. Check the client project's properties and your package.json scripts for how your template version is configured.

Multiple startup projects

If you prefer running the pieces separately, right-click the solution, choose Configure Startup Projects, and start both the server and client projects.