1

If an ASP.NET application contains classes then there are two options: 1) put the classes in the appcode folder or 2) Create a separate class library.

I have found many web pages that discuss the benefits of option 2 and I was already aware of these benefits e.g.

1) The Business Logic layer is separated from the presentation layer 2) Code can be shared between multiple client applications e.g. an ASP.NET website and a VB.NET application client.

I cannot find any web pages that discuss the benefits of option 1.

My question is: are there any benefits to option 1? Am I over thinking this?

w0051977
  • 15,099
  • 32
  • 152
  • 329

1 Answers1

4

Are there any benefits to using App_Code?

It's a bit subjective, but in general, Web Application Projects scale much better than Web Site Projects.

As far as I know, the only benefit of Web Site Projects is that you can change App_Code files with out having to recompile them. But many (myself included) don't like that because it makes it possible to change code on a live web server, which is almost always a bad idea.

App_Code or separate class library?

It depends. If you need to use these classes in multiple projects, create a separate class library. If you only need it in this particular web site, App_Code is perfectly acceptable.

See Web Site or Web Application? and Web Application Projects versus Web Site Projects in Visual Studio for more information.

Community
  • 1
  • 1
jrummell
  • 42,637
  • 17
  • 112
  • 171