> Add a custom ViewLocationExpander to tell ASP.NET where to find the Views
This is the kind of thing that pushed me away from using ASP.NET MVC, Blazor, et. al. The amount of magical boilerplate required is simply oppressive compared to the alternatives:
My only goal when working with ASP.NET Core/Kestrel these days is to get my hands on the HttpContext instance with as little ceremony as possible. Once you have this, you can do whatever you need.
Building your own little web framework around HttpContext will save you unbelievable amounts of time down the road, especially as you have to endure .NET version upgrades. It will also quickly teach you why all the other layers on top are ridiculously overblown.
It takes not even 10 minutes to write reflection code to locate and activate implementations of whatever custom Resource/View/Controller/Route/etc. type you design and then serve them. Dealing static resources is equally trivial. I can write code to pull embedded or SQL resources based on requested route much faster than I can figure out how to configure the official Microsoft static files extension.
2 comments
[ 5.7 ms ] story [ 16.1 ms ] threadThis is the kind of thing that pushed me away from using ASP.NET MVC, Blazor, et. al. The amount of magical boilerplate required is simply oppressive compared to the alternatives:
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/m...
My only goal when working with ASP.NET Core/Kestrel these days is to get my hands on the HttpContext instance with as little ceremony as possible. Once you have this, you can do whatever you need.
Building your own little web framework around HttpContext will save you unbelievable amounts of time down the road, especially as you have to endure .NET version upgrades. It will also quickly teach you why all the other layers on top are ridiculously overblown.
It takes not even 10 minutes to write reflection code to locate and activate implementations of whatever custom Resource/View/Controller/Route/etc. type you design and then serve them. Dealing static resources is equally trivial. I can write code to pull embedded or SQL resources based on requested route much faster than I can figure out how to configure the official Microsoft static files extension.
There is no extension. Static files features ship out of box.
Configuring them is well-documented and usually takes 1-5 LOC: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/s...
I agree that MVC is overabstracted. Please do not do un-cached reflection on each request however, thanks.