Software Development: All About Web Application Projects
Visual Studio can be used to create a Website as a Web Site Project (WSP). This is the traditional way of building the Website, with an HTML file and a Visual Basic code file. Or Visual Studio can create the Website as a Web Application Project (WAP). In this case, an additional Designer file is included – just as for a desktop Project.
Microsoft recommends that Websites be built using the Web Application Project option. This means that Microsoft will be committing more resources to Web Application Projects.
There is no difference in performance between a Web Site Project and a Web Application Project.
Reasons to use Web Application Projects:
Besides the best reason – because Microsoft says so:
- Source code is not sent to the Server
- Publish times are faster
- Edit checking is more comprehensive
- Visual Studio treats the Website as a project
- The Edit and Continue feature is supported
- There is a single assembly for the entire site
- Deployment tasks may be automated
- The Solution and the Project files reside with the .aspx files
This Website has been converted to a Web Application Project. Quite a few problems, hidden previously, were rectified.
Converting a Web Site Project to a Web Application Project
These are the steps to take:
- Add a new Project
- Create a blank Web Application Project.
- Add all the usual folders. If there are VB classes or modules in app_code, move them to a folder called vb_code.
- Add all the CSS, Images, etc.
- Add the Default.aspx file and the Master.aspx – including the VB code files.
- In Solution Explorer, right click Default.aspx and select "Convert to Web Application". VS will then generate a designer.vb file for the page.
- You may have to set Option Strict and Option Infer.
- Add any required References.
- Rebuild All.
- View the Default.aspx page in the Browser.
- If all works, add the rest of the files. Then convert them to Web Application files.
This is a rather tedious process, but you will eventually have a clean Web Application Project without any legacy files.