ASP.NET Core 5 MVC/RazorPages and WebAPI projects in same solution

Many sites are split in two:

  • www.example.com: a public MVC / RazorPages server-rendered app for guests
  • app.example.com: a private WebAPI app for customers and admins (accessible by a SPA)

These two apps share lots of stuff, e.g. code, database, styling, so it would be best to have them within a single solution, possibly split into multiple projects. I expect it's possible to do this by somehow tweaking the standard config (e.g. Startup.cs).

The docs do not cover this scenario. There are various solutions to this problem but they are for older versions of the framework.

How is this done for ASP.NET Core 5?



Read more here: https://stackoverflow.com/questions/65717539/asp-net-core-5-mvc-razorpages-and-webapi-projects-in-same-solution

Content Attribution

This content was originally published by lonix at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: