Beta2 Upgrades For Fun and Profit (posted by Arturo)


Upgrading your existing Whidbey project to Beta 2? Here's a little check list you might find useful.

  • Rename "Code" folder to "App_Code"
  • Rename "WebReferences" folder to "App_WebReferences"
  • Replace "CompilesWith" and or "CodeBehind" with "CodeFile" on all .aspx and .ascx page declarations
    Bulk Replace Tip: find "CodeBehind" replace with "CodeFile"
  • Replace "ClassName" with "Inherits" on all .aspx and .ascx declarations
    Bulk Replace Tip: find "ClassName" replace with "Inherits" but watch out for jscript that references the

    .className attribute of any HTML elements, make sure you turn on "Match Case"

  • Need to explictly declare the inherited class for all codebehind classes (*.master.cs, *.ascx.cs, *.aspx.cs).

    Pre Beta2 the inheritance was implicit.

    Bulk replace Tip: If your pages and controls dont inherit from custom classes you can run a find/replace for

    • "_aspx" to "_aspx : System.Web.UI.Page"
    • "_ascx" to "_ascx : System.Web.UI.UserControl"
    • "_master" to "_master : System.Web.UI.MasterPage"

    searching only in .cs files

  • Need to make all ui element events protected (they arent prefixed by default in the old version making them

    private)

    ex: void btnSubmit_Click(...)
    turns into protected void btnSubmit_Click(...)

    Bulk Replace Tip: if you are in the practice of prefixing your UI member variables with their respective type

    (i.e. textboxes start with txt, buttons start with btn..), and you've used the default event handler names (i.e

    btnMyButton_Click() ),
    this change is made even simpler by allowing you to bulk replace "void btn" with "protected void btn"

  • There are some changes that you need to make to your web service proxy class attributes:
    • "ConformanceClaims" needs to be "ConformsTo "
    • "WsiClaims.BP10" needs to be "WsiProfiles.BasicProfile1_1"
  • Default pages

    If you have more than one Default page in different directories in your app, you're going to need to uniquely

    identify each one
    Ex:

    • GroupAdmin/Default.aspx :: GroupAdminDefault_aspx
    • DivisionAdmin/Default.aspx :: DivisionAdminDefault_aspx
    • Default.aspx :: Default_aspx

    Make sure you update the Inherits page directive accordingly.

You might have to go in manually and correct some compilation errors
caused by the bulk find replaces, but its still quicker than making all the changes manually.
Make sure "Match Case" is selected, this will reduce the danger a bit

Build Started.. Build Successful..


Comments (4)
  1. NVenne says:

    "All *.ascx.cs classes need to explicitly derive form System.Web.UI.UserControl "

    Doesn this apply only to the Beta2 or will this apply to the RTM version too? Because that would for sure break our application.

  2. MSDN Archive says:

    How will this break your application? Let me clarify a bit. What I was trying to convey was the fact that your .ascx.cs classes need to declare their inherited class explicitly. It can just as well be a custom class which itself derives from System.Web.UI.UserControl. Pre Beta2, the generated classes did not provide this explicit inheritance declaration.

  3. NVenne says:

    Then that’s fine!

    I understood that we had to derive from this specific class.

  4. MSDN Archive says:

    Good stuff.. sorry for the confustion. I’ve clarified this point a bit on the blog entry. Thanks!

Comments are closed.

Skip to main content