Web Application Project vs Web Site Project in VS 2005

March 4, 2006

Earlier I posted an article about the new web site model in Visual Studio .NET 2005.  At any rate it appears as though Microsoft is making strides toward introducing the Web Application model into VS 2005, which allows a single assembly and behavior similar to VS.NET 2003.  The new model is far superior to the web site model for serious applications since the web site model appears to have the intention of making web site development projects easier to do.  The only trouble with this is that it seriously hampers your ability to use inheritence in a significant way.

 With Project Insight (http://www.projectinsight.net) we setup our SDK in such a way that the Web Application project is required.  When we deliver our product the web application code behind is delivered in a single dll and the web forms are left uncompiled.  The new web site model in VS 2003 would not have supported this very well.  With that dll, we allow our SDK customers to actually use the assembly as a reference and override our classes to implement their own classes.   This allows the SDK developers to easily modify our existing forms and/or create new forms using our base page classes.   All of the header and footer controls are managed in the base classes so that the interface is automatically rendered and handled.  The new web site model would not have allowed this.

 Another really important feature of the web application model is that within the web project itself, you can now create user controls and other controls and create base page classes that implement functionality based on those controls.  If the developer adds those controls to their page the base class can manage and handle them.  Again the web site project would not handle this, but the web application project would.

For more information on the Web Application Project visit Scott Gu’s blog about it:

 http://webproject.scottgu.com/

Advertisements

7 Responses to “Web Application Project vs Web Site Project in VS 2005”

  1. Paul Says:

    You are Wrong. Web Site Model rocks and you can do inheritence.

  2. Jason Says:

    According to Scott Gu’s blog people should use whatever mode they prefer.

    The Web Application seems to be directed especially at people that are migrating from old 2003 projects. The website mode seems to be directed at people who are just maintaining their own company app/site and they don’t really need everything in a distributable dll.

    However, as usual MS can’t seem to make up their mind so they put out conflicting information and leave us developers scratching our heads – trying to figure out how the hell to write our code so it won’t break with the next version.


  3. Jason,

    I agree with you in that you should choose whichever model works best. When I wrote this what frustrated me was the fact that MS did change the rules. We had already made part of our SDK to allow inheritance directly from our base pages so the customer could inject their own logic using event handlers we created but still keep the base code compiled and safe.

    In the website model you couldn’t do that very easily. Additionally we create base pages that have logic for dynamically changing the header/menus dynamically based on the user. This meant that we had to have the controls for the header (which are ASCX controls) declared in the base page. In the website model you couldn’t setup a class to inherit from base that could “see” the ASCX controls because the website depended on the APP_Code directory. At any rate the Web Application Model that was finally released IN VS SP1 solved the problem. We are currently in the process of finalizing our .NET 2.0 version. It’s been frustrating to have to explain to customers the reason we haven’t upgraded to 2.0 in so long was because of MS not releasing the Web Application model for so long.

    Anyway I hope that in the future we won’t have a big pain in the butt to upgrade. I think we may because we’ve been introducing a ton of AJAX which probably in the future will be complely scrapped for a new model. I am not looking forward to that day.

  4. Robert Hansen Says:

    Of course MS is going to say “use what works best” because quite frankly they don’t know at this point. While many of the ideas in Web Sites are useful the model is incomplete for larger projects, especially the code behind issue. Again, while the Web Application Project works as it did before it leaves you with many of the same issues as before. For some reason (lack of resources?) MS went down a single path (Web Sites) and then realized late in the game that it was no where near sufficient so they created a second path. The real issue is not which path is best but that the set of tools and options are now split apart on two separate paths and we can not choose and pick individually. Either you get a car with power steering, power breaks and manual transmission or one with an automatic transmission but no windows. MS should take note and not split up feature sets like this in the future.


  5. Robert,

    I agree with what you are saying completely. The problem I have had with the website model so far is that every time I have a project that involves that model, we end up hitting a brick wall on something. That is why I think that the web application model is the best.

    The other day we ran into the problem that you can’t exclude a file from the website project and still have it on the server. Also you can’t exclude a file from a deployment package. These are basic things!

    So for now the web app model works best I think.

  6. Robert Hansen Says:

    Yes, the web app project is the best option now, certainly the safest as it won’t lead you down a dead end as you point out. There are some features of the web site model that are nice but on a whole it fails far too often. Hopefully they revisit the whole solution/project organization and come up with something that is homogenous.

  7. Makeup Tips Says:

    Hey darling, nice blog! I genuinely treasure this post.. I was wondering about this for a while now. This cleared a lot up for me! Do you have a rss feed that I can add?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: