November 2017
Intermediate to advanced
800 pages
30h 51m
English
To enable Razor Pages, we must add and enable a service named MVC, because Razor Pages is a part of MVC.
In Startup.cs, in the ConfigureServices method, add statements to add MVC, as shown in the following code:
public void ConfigureServices(IServiceCollection services){ services.AddMvc();}
In Startup.cs, in the Configure method, after the existing statements to use default files and static files, add a statement to use MVC, as shown in the following code:
app.UseDefaultFiles(); // index.html, default.html, and so onapp.UseStaticFiles();app.UseMvc(); // includes Razor Pages
Read now
Unlock full access