You can run both the web and API projects together in Visual Studio by configuring multiple startup projects. Here’s how:
- Right-click on the solution in the Solution Explorer and select “Properties”.
- In the “Common Properties” section, select “Startup Project”.
- In the “Startup Project” options, select “Multiple startup projects”.
- Select the web project and API project from the list and set their “Action” properties to “Start”.
- Click “OK” to save your changes.
Now when you run the solution, both the web and API projects should start up together. You can access the web project at its specified URL (usually https://localhost:port/) and the API project at its specified URL (usually https://localhost:port/api/).