I wonder if it is possible to use the new ASP.NET Core Framework without MVC Core. Are there any examples on how to achieve a small web page without integrating the whole MVC Framework? Serving simple routed razor pages?
You can use MVC Core for REST API only (without using razor views, or for using your own template engine) by referencing only 'Microsoft.AspNetCore.Mvc.Core' package.
If you don't need MVC Core at all, just use '.NET Core Console Application' project template.
Regarding 'old aspx pages' without MVC pattern (from your comment): in current MVC Core version you cannot use razor views without controller; according to ASP.NET Core roadmap, this feature is planned for future 1.2 release.
Yes, you can use Razor pages instead of a complete MVC project.
This Microsoft introduction explains how to use Razor pages and its most important features without the whole MVC framework.
This page uses the following sentences to decribe Razor pages:
As part of the release of .NET Core 2.0, there are also some updates to ASP.NET. One of those is the addition of a new web framework for creating a “page” without the full complexity of ASP.NET MVC. New Razor Pages are a slimmer version of the MVC framework and in some ways an evolution of the old “.aspx” WebForms.
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