Self-Contained UI: Running One ASP.NET Core MVC Site Inside Another

If you have ever used any 3rd party packages like Hangfire or Elmah you will have seen a self-contained UI before. These packages when added to a web project will have their own user interfaces which can be accessed from an admin route like /hangfire or /elmah. These packages don’t bring in any HTML, CSS or JavaScript resources, they just work, and they work well.
If you have ever tried to implement a similar self-contained UI in one of your projects you may have found it quite difficult to set up. The development workflow can also be a bit of a pain. You may have had to make trade-offs on development features like editing your HTML and seeing it refresh without having to recompile the app.