How to run and host an ASP.NET Core MVC API and Blazor WebAssembly as a single Solution? [duplicate]
Asked Answered
A

1

5

We have an Single Page Application which runs with the JavaScript framework knockout.js on the client-side. On server-side the solution has an ASP.NET MVC which includes some ApiController classes for our REST APIs. We want to exchange the client-side JavaScript code by Blazor WebAssembly. How can we use Blazor WebAssembly in combination with ASP.NET MVC. The most online documentations only show how to user Blazor WebAssembly with Blazor Server. We not want Blazor Server because we already have the MVC and want to keep our REST interface which is realized by the ApiController classes.

A first naive prototype solution has a Blazor WebAssembly project and an ASP.NET Core MVC project:

enter image description here

Problem: When either can Start the client-side Blazor WebAssembly project (ToDoList) by pressing strg+F5 (which has port) or I can start the server-side MVC-Project (ToDoListAPI) but not both, client and server in combination, as I am used to with my SPA written in JavaScript.

Apollo answered 3/4, 2020 at 10:9 Comment(1)
Does this answer your question? Running two projects at once in Visual StudioKozloski
O
8
  • Right click on your solution
  • Click on Properties
  • Select Multiple startup projects
  • Select Start action on projects you want to debug

Or if you want to debug only one project

  • Open a command prompt in the project folder you want to start without debuging
  • Launch dotnet run
Ostium answered 3/4, 2020 at 10:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.