Welcome to AspAdvice Sign in | Join | Help

Orcs Goblins and .NET

I enjoy reading and writing. I hope you enjoy at least the former. I have moved my blog to Brendan.Enrick.com.




Locations of visitors to this page



Advice Sites




Web Application Projects are better than Web Sites

Recently I was explaining the difference between the web application project and the web site to the budding developers I've been working with. I suffered greatly while using web sites instead of web application projects. I remember having a great deal of pain while my assemblies dueled each other. Scott Guthrie posted about the dueling assembly problem.

Dueling Assembly Reference Problem

The problem I refer to as a “dueling reference” occurs when you setup multiple file-based references to assemblies from a VS 2005 Web Site Project that are each updated dynamically (using .refresh files), and which in turn have dependencies on different versions of a common shared assembly library.

This one reason was more than enough in my opinion to switch to web application. It took some sites which could take upwards of five to ten minutes to compile and made them take ten seconds. I can't ask for much better improvement there.

Another great benefit of using Web Application Projects instead of using the Web Site is that there is a project file managing what is and is not included. On a few of the projects I've worked on in the past we have had some trouble with source control and web sites. It is much easier if you can just define what is and is not included in the web site. With the classic web sites, it was a loose system. The site was defined as a folder in the file system. With the web application project your site is defined using a project file which dictates which files will and will not be included.

On really annoying part of web sites are the refresh files used for adding assemblies into the bin folder. There are files which say where the assembly can be obtained. If you're working with source control you need to have these files in source control. The problem is that you need to not have the actual binaries in that location in source control or the refresh files will not work correctly. This creates some huge headaches because Visual Studio wants to check in these files (assemblies) being included by the refresh files. Ouch.

The feel of web applications is more consistent with everything else in Visual Studio. This consistency is nice, since there now is "Open Web Site" and "Open Project". It is quite annoying to have two different things to work with. If they were both just project that would make it so much simpler.

Far too many people are still using the sites, so I doubt that Microsoft will remove them from future versions of Visual Studio anytime soon. It doesn't really hurt me to have them, but I pretty much exclusively use Web Application Projects over Web Sites. I even do this for small little one shot sites. I've just grown to like them so much that I cannot turn back.

If I have to deal with refresh files again, I'll just go crazy.


Published Thursday, June 12, 2008 5:56 PM by Brendan

Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS


# re: Web Application Projects are better than Web Sites @ Monday, August 4, 2008 4:48 AM

I've been using Web Application Projects recently, having just moved from Web Sites two projects ago (err... I know that's a fairly subjective measuring unit of time, but it's about a year ago). The problem with Web Application projects is that Visual Studio doesn't support the Edit-and-Continue feature. Any time I make a change, I have to stop the application and start it again - just the compilation takes almost forever. Sure, some people prefer Web Application projects, but it's a real time-leech (without the Edit-and-Continue) in the development phase.

Nitin Reddy Katkam

# re: Web Application Projects are better than Web Sites @ Monday, August 4, 2008 9:04 AM

@Nitin Yes, the amount of compilations does increase when using web application projects, but I've actually noticed less time stuck waiting. The reason being that compilations used to take much longer.

Because of the dueling assemblies problem I was mentioning. Took builds that took 10 minutes and makes them take about 10 seconds, so I've actually noticed found that it speeds up the development process.

I guess it depends on whether you're getting the dueling assemblies problem. Thanks for the extra perspective on that.


# re: Web Application Projects are better than Web Sites @ Sunday, August 17, 2008 4:29 PM

One of the reasons i use a website is I thought that a web application doesn't build the typed 'profile' class?

Chris Percival

Leave a Comment

Enter the code you see below