visual-studiovs-web-site-projectvs-web-application-project

Why does a web application project in VS2005 offer a 'Convert to Web Application' menu choice


I believe I understand fully the differences between Visual Studio 2005's web site model versus the web application project model that was fully delivered in VS2005 SP1 - but I have run into a confusing thing:

I have a web application project I wrote (it has a bin folder with the compiled projectname.dll and referenced .dlls too, etc.). but I just noticed that if I right-click on the project within Solution Explorer, a menu item called "Convert to Web Application" is exposed). That makes no sense to me.

I was comparing this project to a "web site" solution in VS2005 and contemplating converting it to a web application project. Strangely, the solution explorer offers nothing related to "Conversion to Web App" here like one would think is possible and/or appropriate.

I conclude there is nothing to help automate changing a "web site" construct to a proper "web application project". I assume it all has to be done by hand. Tasks such as reconstituting files in App_Code into one or more class library projects needs to be done manually.

I realize a lot has been written about the history and differences but can someone explain why the offer to "convert to web app" seems to be made in the "wrong" model - and just confirm that conversion is manual.


Solution

  • The conversion wizard does a decent job -ie, the process is far from being strictly manual - but you're still going to spend a lot of time moving from the website to web application model.

    The "Convert to Web Application" context menu option for aspx pages generates a myclass.designer.cs file, which ties controls defined in markup back to the codebehind class, allowing for intellisense, compile-time validation, and other things.

    Performing this action on a project file should generate designer files for all of the aspx's in the project, and I believe also creates some default application settings such as assembly name, etc, that aren't defined in a website project where the output is source, not an assembly.