views:

2970

answers:

6

I have upgraded a MS Visual Studio Application from VS 2003 to VS 2008 (Targeting .NET 2.0). As part of the conversion process the wizard said I needed to take the additional step of Converting my Project to a Website by Right-Clicking and blah blah blah...

I didn't follow directions and the web application seems to be working fine.

My question is, should I be concerned about pushing this to a production system? What exactly is going on here?

Thanks in Advance!

+3  A: 

There are two types of web applications in ASP.NET: The Web Site and Web Application Project. The difference between the two are discussed here:

Difference between web site and web applications in Visual Studio 2005

Convert to Website allows you to convert a Web Application Project to a Web Site.

Visual Studio 2003 used the Web Application Project style, but initially VS2005 only supported web sites. VS2005 SP1 brought back Web Applications.

If you don't want to convert your project to a web site, apply SP1 if you're using VS2005. VS2008 can support either.

Jon Limjap
+2  A: 

Convert to Website moves all of your control declarations from the main page class to a secondary file (yourpage.aspx.designer.cs).

It does this by using a partial class. That is, the same class for your page, but split into two seperate files.

This allows the VS2k5 (and VS2k8) designer to generate code for your pages without dumping generated code spaghetti into the main class file.

You don't need to do this step to build the project, but if you continue to maintain the project you will want too.

EDIT:

Hey look, MSDN backs me up:

To convert the code to use the partial-class model

  1. Make sure the code compiles without errors.
  2. In Solution Explorer, right-click the project name and click Convert to Web Application. This command iterates through each page and user control in the project. It moves all control declarations to a .designer.cs or designer.vb file. It also adds event handler declarations to the server-control markup in the .aspx and .ascx files.
  3. When the process has finished, check the Task List window to see whether any conversion errors are reported.
  4. If the Task List displays errors, right-click the relevant page in Solution Explorer and select View Code and View Code Gen File to examine the code and fix problems.
  5. Recompile the project to make sure that it compiles without errors.
FlySwat
A: 

There are two types of web applications in ASP.NET: The Web Site and Web Application Project. Convert to Website allows you to convert a Web Application Project to a Web Site.

As far as I can recall, Convert to a Website does not do this, the Web Application project is a regular application structure with your typical \bin etc.

The WebSite project instead is based upon the concept of an App_Code directory for classes, and an App_Date directory for data, with your regular ASPX files going anywhere. The idea is to avoid having to precompile into DLL's before deployment, which can be easier in some shared hosting situations.

I am not aware of any wizard that will restructure the project between these types, but I may be wrong.

FlySwat
+1  A: 

The only thing you might have missed was whether or not you wanted to make a backup of the 2003 project (just in case). It's no big deal.

Check out:
Converting a Visual Studio .NET 2003 Web Project to a Visual Studio Web Application Project

Visual Studio Conversion Wizard

Alison
A: 

Convert to Website moves all of your control declarations from the main page class to a secondary file (yourpage.aspx.designer.cs).

Why would I want to do this? It's bad enough that there is a .js .css .vb .aspx file for each page. Do I really need to split up the .vb into two more files just so I can hide the declarations ? page.designer.aspx.vb.h anyone?

DrFloyd5
A: 

@all Thanks for the replies.

DrFloyd5