I have a couple of pages common across all my ASP.NET projects. I would like to centralize that code inside a single assembly. How can I achieve this? Is it possible to simply create and assembly and add it as a reference of my ASP.NET projects and the pages are going to be accessible?
Using razor views from a different (so from outside the web project) is not supported out of the box. However there a tool to precompile razor views and then you can put them in any dll. This custom tool is called RazorGenerator.
There are some blog posts where you can start:
Precompile your MVC Razor views using RazorGenerator
Compile your asp.net mvc Razor views into a seperate dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With