Re-use Controllers, Views and Tag-helpers in ASP.NET Core

I recently ran into a situation, where I needed to implement the same functionality, the same views and even the same tag-helpers for different customers. Like most other developers I hate copy-pasting code that should be shared across multiple projects. I had come across a similar need a few years back, but remembered that it was cumbersome in ASP.NET 3-5, to achieve this, and the solutions back then didn’t feel right. But since my recent switch to dotnet core, I knew there was a chance that Microsoft had a prepared an early christmas present for me. So I started researching my options, searching for titles similar to this blog post, and finally found a solution on the third place on google (Yes I was that desperate). Introducing Application Parts / App Parts With the introduction of ASP.NET Core v1.0, MVC came with a new concept called “Application Parts”, which is how the features and resources is populated into a ASP.NET Core MVC application. MVC loads it’s features from different application parts, which is a new type in ASP.NET Core. Specifically for my use-case, it can load the parts of an application from another Assembly (read: dll file). By creating an AssemblyPart object, you can discover controllers, views and tag helpers from a shared library. Adding controllers from a shared project Consider that I have a basic MVC site called “MyWebApp”, and another project called “SharedModule”, of which MyWebApp has a reference to. The SharedModule is created as an Empty MVC site, and then later populated...