In our previous episode we looked at differences in the DaveBu and ScottGu migrated VS2005 projects. Now we'll take a look at when and why the Abstract Stub Classes are created.
If you recall from the side-by-side VS2005 Solution image, a number of UserControl classes were created in the \app_code by the Migration Wizard in section (1). If we recall a basic precept of ASP.NET Architecture, a class in the \app_code cannot reference classes outside of the \app_code area because all classes are compiled into individual assemblies. And because all classes are compiled into individual assemblies, classes cannot be referenced by other classes like in the ASP.NET 1.1 single DLL model. Good information on this is in the MSDN ASP.NET 1.x Upgrade area.
So, a quick look into VS2005 Abstract Stub Classes as it applies to my sample project. My wizprojbase.cs class was moved to the \app_code directory by the VS2005 Migration Wizard. In it we reference a UserControl as we normally would.
public class wizprojbase : System.Web.UI.Page
{
.....
protected C_Wzprojform2 uc_wzprojform2;
}
The migration wizard renames [outside the \app_code directory] wizprojupd.cs to Migrated_wizprojupd, makes it a partial class and inherits from [inside the \app_code directory] wizprojupd.
public partial class Migrated_wizprojupd : wizprojupd
{
.....
public override void ShowForm2()
{
......
uc_wzprojform2.FillBlock(PackValues());
uc_wzprojform2.ShowTeam(pid);
uc_wzprojform2.ShowTeamFromDB(pid);
}
}
[Inside \app_code] wizprojupd inherits from [inside \app_code] wizprojbase.
abstract public class wizprojupd : wizprojbase
{
.....
}
What I want to point out is the UserControl stub and why the Migration Wizard created one. Looking in the Migrated_wizprojupd class (outside \app_code), we are referencing 3 methods in the (inside \app_code) C_Wzprojform2 class. So the Migration Wizard creates a stub containing the referenced methods.
abstract public class C_Wzprojform2 : System.Web.UI.UserControl
{
abstract public Project PackLocal(Project _project);
abstract public void ShowTeam(int pid);
abstract public void ShowTeamFromDB(int pid);
abstract public void FillBlock(Project _project);
abstract public void ShowFinish(string AddEditMode);
}
In our next episode we'll examine the mystery of why only one System.Web.UI.Page wizard stub was created in the \app_code directory...