1

When Microsoft introduced this special folder? What it is for? When the app start, we already have

 void Application_Start(object sender, EventArgs e)

in global asax, so what about app_start folder?

could perhaps serve to solve the problem that happen when you debug your app in iis: in this scenario Application_Start event fires only one time when the app pool go up so if you want to refire the event you should stop iis?

sparrows81
  • 431
  • 3
  • 6
  • 19

1 Answers1

3

App_Start is not special ( App_Start Folder in ASP 4.5 only in WebApplications Projects? ), and in fact the classes contained within have methods that are called directly from Global.Application_Start - the reason they're there is to split things up to make it more maintainable. It makes more sense to have URI routing and resource bundling logic in their own files instead of all crammed into Global.asax.cs.

Feel free to move the files around elsewhere in your project's filesystem if it makes more sense to you - the default arrangement is just a convention, like how client-side files are stored under /Content.

Despite the underscore in the name, App_Startup has no "magic" behaviour that we see in App_Code, App_Themes or App_Browsers (those folders were defined as part of the ill-fated "ASP.NET 2.0 Websites" project system in Visual Studio 2005 (when Microsoft wanted to move developers away from ahead-of-time compiled website projects into something more closely resembling PHP projects in order to reduce the learning-curve, but it instead added more complexity and special-cases).

Community
  • 1
  • 1
Dai
  • 141,631
  • 28
  • 261
  • 374
  • I'm not putting an underscore on this folder anymore to avoid confusion. That's what led me to believe it had some old-school ASP.NET behavior. – AaronLS May 06 '21 at 19:22