views:

397

answers:

2

I created a Web site in VS2008. I'm wondering if I should have created it as a project instead and, if so, can it be converted? Any advantages/disadvantages to either approach?

TIA

+1  A: 

This may sound a bit obvious, but I think it's something that is misunderstood because VS2005 only shipped with the web site originally. If your project deals with a website that is fairly limited and doesn't have a lot of logical or physical separation, the website is fine. However if it is truly a web application with different modules where many users add and update data, you are better off with the web application.

The biggest pro of the website model is that anything in the app_code section is dynamically compiled. You can make cs file updates without a full redeploy. However this comes at a great sacrifice. A lot of things happen under the covers that are difficult to control. Namespaces are difficult to control and specific dll usage goes out the window by default for anything under app_code since everything is dynamically compiled.

The web application model does not have dynamic compilation, but you gain control over the things that I have mentioned.

If you are doing nTier development, I highly recommend the web application model. If you are doing a limited web site or a quick and dirty implementation, the web site model make have advantages.

More detailed analysis can be found here:
http://west-wind.com/weblog/posts/5601.aspx
http://blogs.vertigo.com/personal/swarren/Blog/Lists/Posts/Post.aspx?ID=10

Daniel Auger
A: 

There's some information on an old blog post of mine about the differences between the Web Site and Web Application project - http://www.aaron-powell.com/blog.aspx?id=1126

Personally i always use/ convert existing projects to Web Applications as I find them a lot more powerful and configuravle.

Slace