App_Code folder is missing in VS 2010

Viewed 60499

I was trying to create a Dynamic Data Website using VS 2010 RC. An attempt to create an App_Code folder where I would put a LINQ to SQL class, failed. When I selected 'Add ASP.NET Folder' to add the folder, I had options to create only the following folders:

  • App_GlobalResources
  • App_LocalResources
  • App_Data
  • App_Browsers
  • Theme

What happened to the App_Code folder?

8 Answers

Why not create another project, a class library, and put it in there. That's by far the best way to keep those classes separate from the rest of your website.

To answer your specific question about the App_Code folder, it's available in WebSite projects as an Asp.Net folder you can choose from. But from a web application project, you can just create a new folder and name it App_Code and it will work just fine. This is as of Visual Studio 2010 RC.

I also found this funny that it is missing. The thing is you "don't" need to create the App_Code folder you just add the classes to any new folder.

In VS 2005 any class outside the App_Code would give a compile error.

So I also want to know why they decided to remove this constraint? Was it because of people complained about it, or did the design concept changed and it was deemed necessary?

Related