October 2018
Beginner to intermediate
478 pages
10h 8m
English
ASP.NET MVC Core does not work by default in ASP.NET Core applications. You must enable it within the code before using it. To do so, follow these steps:
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); }
This tells ASP.NET Core to add MVC to the available services. Pay attention — this is not enough for MVC to work, since it needs to be configured first.
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseStaticFiles(); app.UseMvcWithDefaultRoute(); }
This instructs ASP.NET Core to use ...
Read now
Unlock full access