Use of AuthConfig, BundleConfig, FilterConfig , RouteConfig and WebApiConfig in App_Start() folder in MVC

Harsha V Chunduri picture Harsha V Chunduri · Nov 13, 2013 · Viewed 63.7k times · Source

Can you please explain in detail, the use of App_Start() folder in MVC4? I see that this folder is actually not available in previous versions of MVC. There are 5 files in this folder.

  1. AuthConfig
  2. BundleConfig,
  3. FilterConfig,
  4. RouteConfig,
  5. WebApiConfig.

Answer

Spock picture Spock · Nov 13, 2013

App_Start is just another folder that groups together ASP.NET MVC configuration, which in previous versions of ASP.NET MVC was done in Global.asax.

ASP.NET MVC introduces more and more configuration elements, and this folder is ideal to place this configuration. For example, MVC 5's new auth. configuration, such as for third-party login providers, are also placed within this folder (in Startup.Auth.cs).

App_Start is not a ASP.NET special folder recognized by ASP.NET/IIS. You can rename the folder if you want. The name is just a convention, like App_GlobalResouces etc.

Update:

Below are some information and reference points for each file. The use of these files are pretty straightforward. I have included few online references that might help your to understand more.