Welcome Login

Project systems: web application projects (WAP) verses web site projects (WSP)

Use web application project (WAP):

1. If do not want your source code openly available on production servers.

In WAPs, the .aspx.cs files are compiled in Visual Studio and converted to a .dll which actually resides in bin folder of your project.

The generated dll is named as <MyProject>.dll by default.

In case of WSPs you need to deploy your .aspx.cs files.

WAPs uses Visual Studio to call the C# compiler to compile the .aspx.cs files whereas in WSPs the Asp.net runtime compiler calls the C# compiler internally on the production server.

2. If you want to unit test your source code which is present in .aspx.cs files.

As WAPs generate a dll out of your .aspx.cs files you can easily create a Unit Test project using MBUnit, NUnit, VS Unit Test etc and add a reference to the WAP dll.

In case of WSPs there are no dll generated, hence it is difficult to reference that code and write unit tests for them.  Note: if you have factored your C# source code in a class library and are unit testing that library then WSP projects will work just fine.

3. If you intend to leverage Web Deployment features of VS 2010 and MsDeploy.

4. If you intend to write Asp.net MVC projects.

5. If you want to edit your code while debugging.

Edit & Continue feature is supported only in WAP projects and not WSP, hence if you care about Edit and Continue then WAP is your option of choice.



Use web site projects (WSP):

1. If you intend to deploy source code on your production server and edit it right on the server if there was a time sensitive bug reported.

2. If you want many developers editing the deployed site.  WAP does not give you an option to edit .aspx.cs files on the server directly, hence you will need to use WSP in this case.

3. If you intend to update just few .aspx and .aspx.cs files and do not want to recompile your project.

4. If you code inline C# in the .aspx file (in addition to/instead of writing it in .aspx.cs).

Some developer code inside <script runat="server"> tags in .aspx pages.  If you do so, WSP provides better intellisense and refactoring.

Note: code written in .aspx pages, even in WAPs, does not get compiled by Visual Studio.  The code in .aspx pages is unchanged is and is compiled by Asp.net compiler on the server.  So essentially even if you are using WAPs you can also edit the code written in .aspx on the production server.



For more information, see here.

Created on: Tuesday, May 1, 2012 by Andrew Sin