Skip to content

Instantly share code, notes, and snippets.

@CoreProgramm
Created May 8, 2020 12:07
Show Gist options
  • Save CoreProgramm/514245cd2e21b41434925f55314a8165 to your computer and use it in GitHub Desktop.
Save CoreProgramm/514245cd2e21b41434925f55314a8165 to your computer and use it in GitHub Desktop.
Difference between AddMvc() and AddMvcCore()
public void ConfigureServices(IServiceCollection services)
{
var builder = services.AddMvcCore();
builder.AddJsonFormatters();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseMvcWithDefaultRoute();
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment