We still need AreaRegistration.RegisterAllAreas () in Global.asax in a pure ASP.NET Web API service without MVC

I am trying to create a clean ASP.NET web API without reference to MVC assemblies, if possible. I followed this blog http://www.codeproject.com/Articles/615805/Creating-a-Clean-Minimal-Footprint-ASP-NET-WebAPI but with this line in Global.asax I still have to import the assembly System.Web.Mvc. Will there be an impact on my web api service if I remove it? I tried to start my service in my local without it, and I did not find any errors.

protected void Application_Start() { //AreaRegistration.RegisterAllAreas(); do we still need this? WebApiConfig.Register(GlobalConfiguration.Configuration); HandlerConfig.RegisterGlobalHandlers(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters); } 
+6
source share
1 answer

If you are not using MVC areas, then you do not need to call AreaRegistration.RegisterAllAreas()

+14
source

Source: https://habr.com/ru/post/952362/


All Articles