Under my WebApi project, I don't know what this line
GlobalConfiguration.Configuration.EnsureInitialized()
is doing there in Global.asax Application_Start()
method. Even every thing is working good without this.Then why is this for?
Is it necessary to be here? If yes then why? Can any one explain its need and purpose in detail.
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
//////////// What is this for ////////////////
GlobalConfiguration.Configuration.EnsureInitialized();
}
NOT A DUPLICATE : In stack overflow many people suggest to use
EnsureInitialized()
.But Why to use it? Where it comes from? Is it part of webApi2 or something else? These are are the things I want to know. MSDN itself has no explanation for this.