| |
Web Site (WS) |
Web Application (WAP) |
Comments |
|
Tools support |
VS.NET, Web Developer, notepad |
Requires VS.NET 2005, SP1 and later |
|
|
Supported page code models |
Code-beside
Code-in-page |
Code-behind
Code-beside
Code-in-page |
All code models work in both models, including the code-in-ASPX model.
Code-behind also generates a partial class for code declarations in a designer.cs file |
|
Time for full site compilation |
Very high |
Normal |
The time to compile a WS scales in an almost linear fashion with the number of pages in the project. For a medium-sized projects, a full-site compile for a WAP can be 10x faster than a full-site compile for a WS.
Full site compilation can have a significant impact on developers that use VS.NET refactoring features. |
|
"Magic" |
Mostly compile-time magic:
Namespaces can be random and generated at compile time
DLL are randomly named at compile time
Assembly references are inferred from #using statement and DLLs in the bin directory |
Mostly design-time magic:
.designer files are generated for control declarations |
Overall, WAPs are much less magical.
Less magic can be helpful for cases where you want to exercise explicit control over how components appear to each other.
Magical assembly references in WSs can be harder to manage for a team project. |
|
Production recompilation vulnerability |
Utilities that touch source files in the production environment (like virus checkers) can cause recompilation, and may cause an app restart as well. |
n/a |
For WS projects, this vulnerability can be mitigated by compiling the entire site to a DLL. |
|
Deploy changes to only part of the web application |
Because the page DLLs are magically named at compilation time, it's often difficult to replace a single page without restarting the application. |
Partial changes can be deployed by copying markup files (if needed) and the site DLL to the production server. |
Contrary to what most folks would guess, the magical compilation of WSs makes it a bit more difficult to deploy partial site changes than for WAPs. |
|
Team-wide code analysis rules supported? |
no |
yes |
Code analysis rules are part of the project for WAPs, and can be standardized and checked in for the whole team. WSs support unshared personal rules only. |
|
Resources |
The WS model splits the majority of string resources in separate, per-page resource files. It's possible to use Global resources, but more clunky. |
Per-page or explicit models supported. |
Per-page file approach can increase the cost of localization (round-tripping multiple files to the translation vendors). |
|
XML documentation support (VS.NET) |
no |
yes |
|
|
Strongly-typed MasterPage support |
no |
yes |
Using strongly-typed MasterPages, you can define members on the MasterPage that are available to all of the derived pages, without resorting to reflection. |
|
Supported by Team System Build? |
no |
yes |
|
|
Project to project references supported |
no |
yes |
For WSs, you must copy the built DLLs into the WS's bin folder, either manually or by doing some fiddling with the build output path in the component project. |
|
Cross-project debugging supported |
sorta |
yes |
With project to project references (WAP), you can debug into a component project in the solution with no additional setup. It just works. For WSs you must build a debug version of the component and manually attach to it during your debug session. |