Web Application Projects vs. Web Site Projects

May 8, 2007

When Visual Studio 2005 was released together with ASP.NET 2.0, the web project model was totally changed from the ASP.NET 1.x model. It took some time for me to get used to it, and in the beginning I didn’t like it much. Apparently, I was not alone and Microsoft got a lot of mail from developers who wanted the old Web Application Project (WAP) model back. Visual Studio 2005 Service Pack 1 then reintroduced the WAP model.

I never really understood why so many people wanted the old model back, because it has some serious inconveniences. My guess is that almost all of the people who wrote Microsoft wasn’t web developers to begin with, but maybe had a past doing Windows Forms to which the WAP model bares many similarities.

No change 'n review

Old school web developers like to make a small change and then see how it looks and continue to do so an awful lot of times. The WAP model doesn’t allow you to do quick changes and review them at once. You first have to compile the entire project and that can easily take 30 seconds for larger web projects. At work, we have a web project that takes 3 minutes to build.

That quickly gets very annoying and is just a waste of time. The Web Site model does not have that problem.

No quick ‘n dirty editing

In the WAP model, if you don’t have Visual Studio you cannot change anything but the layout and that is really annoying. When I’m away from my Visual Studio and finds something I want to change, then I’m not able to. The Web Site model on the other hand allows me to change anything I want using only Notepad and the build-in FTP capabilities of IE.

Annoying deployment

The initial deployment in the WAP model is easier because there are fewer files to be FTP’ed to the remote location. But if you want to make a small change and deploy it, then you have to FTP the dll file which can be several hundred kilobytes. Now you think: how can that be a problem on your super broadband connection? Well, it can if I’m doing small changes an awful lot of times and need to upload them to review them. Then that extra 5 seconds of upload time just get on my nerves.

In the Web Site model you just upload the file you changed. That’s 2 kilobytes versus 200 kilobytes.

What I’m trying to say is, that I don’t understand the popularity of the WAP model…

* Only $4.95/month ASP.NET & Windows 2008 + IIS 7 Hosting! FREE SQL Included

Comments (11) -

Al Nyveldt
Al Nyveldt United States
5/10/2007 1:42:45 AM #

I hear what you are saying and I agree for the most part.  The newer model is just plain easier for me in many regards.  I went through the dislike (and distrust) at the beginning, but I'm over that now.

One thing the older model has going for it is for the hosted server world.  You might not want to upload all that code out to a someone else's box.  Of course we also have the pre-compiled site option (www.nyveldt.com/.../Precompiling-ASPNET-20.aspx) which is even more secure, but even a more difficult to deal with than the WAP model.

Poul
Poul Denmark
5/10/2007 6:51:14 AM #

Basically what you're saying is that the WSP-model makes it easier to hack. That's exactly why we're sticking with the WAP-model. To enforce all infrastructure setup to ensure quality; Code goes though a build-process, integration test, unit test and so on.

Also, another big problem with the WSP-model is that you have to learn two methods of doing stuff in Visual Studio - I like having all project look alike, and configured the same way.

I have worked with ASP in 5 years and the WSP-model does look a lot more like that - It's exactly what I want to move away from.

Luke Foust
Luke Foust United States
5/10/2007 3:36:44 PM #

One thing I miss about the old model is the ability to pick and choose which files will be included in the project instead of having the website just pick up every file that is in it's folder structure. This has not been a show stopper for me yet but it has caused me to work around in some cases.

Brian Lowry
Brian Lowry United States
5/10/2007 4:37:30 PM #

I don't know about anyone else, but for me, the WSP-model made Visual Studio crawl. Also, as Luke stated, the WSP-model created many problems with source control because it picked up everything in the website directory.

The only advantage is the ability to quickly check updates by F5 in a browser, and for me, I find the WAP model a much better fit.

DarkoZa
DarkoZa Slovenia
5/10/2007 6:18:04 PM #

Old WSP-model has many problems with source control. The new WSP-model doesn't have this problems.
If you have just WebSite you can't create XML document output file and in this case you can't create generated documentation.

Sean
Sean Canada
5/10/2007 7:12:40 PM #

The advantages you describe -- lots of small, frequent changes, being able to do quick hit changes on the fly, changes with tools that aren't integrated into source control etc. -- are all things we want to discourage in our development process so for us they are actually disadvantages.  That's why we were quick to jump on the new WAP bandwagon and are happy to be there.  Oh yeah, some of us are old school web developers too.  ;)

TruFire
TruFire United States
5/11/2007 8:42:16 PM #

Sorry but software has no place on the www. Not now..not ever. It's sad, I know, but too many programmers went to schools that taught them how to build software instead of web sites. Unfortunatly, for them, the whole world is going to web based services. There is a reason that websites aren't built in MSWord. Wink

There were several mis-statements in some comments which I would like to correct.
First of all, Visual Studio is MS's software development tool. FrontPage, Expression We and SharePoint Designer are MS's web development tool.

If you notice when you work on web parts you often have to put VS in FrontPage mode. VS cant execute the web function in its native context.

To use source control on the MS platform check "use source control" on the server admin and then use FrontPage etc. to click on the sitye folder to "check out" to activate source control on the site. You can do this on the sublevel such as files etc. too.

FrontPage, Expression We and SharePoint Designer all have "convert to" WAP, WML, and XML funtions. Not to mention better optimization than VS could ever dream of.

Use VS if you can't write code and need everything in a push-button menu selection, and your boss dosent care if it takes you a week to do a day's work.

Websites can run off of IIS for log-ins. IIS is fully backed by MS for www security by thousnads of man hours of security work. WAS usually use a SQL db logon which actually can "guide" a hacker how to bust the app through the exceptions display!

RE: Getting site to look the same? Use your templates and themes. Save custom work as snippets for repeated use.

Please use some common sense. There is a reason that websites and software are two different things. Web technology is "built from the ground up" to endure the hostile environment of the www and to efficently transmit and recive data/media. Most software is clueless in this area.  I've seen so many app sites that are streaming ASCII..it's a joke!

Did you know that Ascii and other non HTML- TCP/IP actually use two data streams? That can eat you alive. Notice how your web "admin panel" askes you what port to use for your site. It's gonna get kinda goofy if yo're running two streams.  

If you want it in your browser...build a website.



Dan
Dan
5/15/2007 8:37:18 AM #

The Web Site Projects are VERY flexible, I use a custom BuildProvider to generate a factory method that return types without the cost of using late-binding with Activator.CreateInstance.
And it is very powerful to monitor assemblies dependencies, each directory in App_Code is compiled to a separate assembly and you can set the order in web.config. If you want to make some code generic and reusable but you are using it in a concrete project set the directory the first to compile. If you put non desired dependencies the compilation will fail.

The App_Code folder is a dream come true.

JoeGeeky
JoeGeeky United States
5/26/2007 4:43:52 PM #

For us the WAP model works better...  Since we are a Visual Studio Team Systems-based team we want to take full advantage of things like policy-based code analysis, unit testing integration, continuous integration/nightly builds, etc...  While this is certainly possible with a non-WAP solution, it is much easier if its a WAP.  Additionally, management of references is cleaner, especially when you consider the impact on projects maintained in TFS Source Control.  Finally, deployment using TFSBuild is much much easier; even if it is slower...  This is also not limited to Web Site Projects, because many of the same issues exist (on both sides of the discussion) for Web Service Projects.

Aaron
Aaron United States
5/30/2007 12:26:25 AM #

Spoken like some one that does not sale software.  If your distributing a product WAP is much better.  If its internal to the company and you own the box WSP works.

Will
Will United States
5/7/2008 11:56:51 AM #

"In the WAP model, if you don’t have Visual Studio you cannot change anything but the layout and that is really annoying."

That's not exactly true.  One of my projects at work is a web app, and I used the WAP so I could easily create an install project (you're right, its the forms designer in me that drove me to do it).

You can select the compilation model in WAPs.  You can push out a fully compiled DLL with all pages and code, or push out pages with codebehind in DLL's, or leave your code in the .aspx pages themselves instead of the codebehind.  I believe, but I'm not sure, that you can also push out your .cs files as well and let ASP.NET compile all your codebehind files on startup.  I never did the last one, tho.

Comments are closed

About the author

Mads Kristensen

Mads Kristensen
Program Manager at the Microsoft Web Platform team and founder of BlogEngine.NET.

More...

Month List

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.