Upgrading the WoodgroveNet Sample Site
Updated: January 26th 2005.
A number of people have requested information regarding upgrading the WoodgroveNet Sample Site to an
MCMS SP2 application which uses ASP.NET 2.0 and Visual Studio 2005. Whilst the WoodgroveNet sample is
not considered best practice in many areas and certainly does not demonstrate any SP2 concepts, it can
be useful in assessing the impact of upgrading your MCMS applications.
This article provides a walkthrough of upgrading the WoodgroveNet Sample to run on ASP.NET 2.0 and be
developed using Viusal Studio 2005.
Step One: Make a backup!
Before proceeding make a backup of the Sample Data files created by the WoodgroveNet installer.
- Using Windows Explorer navigate to the MCMS installation folder (usually C:\Program Files\Microsoft Content Management Server).
- Right click the Sample Data folder and click Copy.
- Right click any white space in the Explorer window and click Paste.
Step Two: Upgrade the WoodgroveNet application.
The WoodgroveNet sample consists of two projects, WoodgroveNet itself - a MCMS Web Application and a Control Library project named MCMSWebControlLibrary.
Upgrading the Control Library project is uneccesssary, and most of its functionality would be naturally be replaced by SP2 features, doing so would also
vastly increase the upgrade effort.
- Using Windows Explorer navigate to the WoodgroveNet project folder (usually C:\Program Files\Microsoft Content Management Server\Sample Data\WoodgroveNet).
- Double-click the WoodgroveNet.csproj file to launch the Visual Studio Conversion Wizard.
- On the Welcome to the Visual Studio Conversion Wizard dialog, click Next.
- On the Choose Whether To Create a backup page, select the No radio button and click Next. (We have our backup from step one)
- On the Ready to Convert page click Finish.
- On the Conversion Complete page click Close to open the Conversion report.
You should see three warnings. One is related to the default console, which can be ignored as can the item concerning resources (for the time being).
The other warning is related to the type of Web Site project created, we will address this next.
- From the File menu click Close Solution, and when prompted click No.
Step Three: Modifying the Web Application and opening as a IIS Web Site.
The WoodgroveNet Virtual Directory in IIS is still configured to use ASP.NET 1.x. We need to change this before proceeding
- From the Start Menu click Run....
- In the Open... text box enter inetmgr and click OK.
- Expand the tree view to show the WoodgroveNet Virtual Directory.
- Right click the WoodgroveNet Virtual Directory and click Properties.
- Click the ASP.NET tab, select 2.0.50727 in the ASP.NET version combo box and click OK.
- Close Internet Information Services and switch back to Visual Studio 2005.
- From the File menu click Open, followed by Web Site....
- In the Open Web Site dialog click the Local IIS icon and the WoodgroveNet Virtual Directory. Click Open.
Step Four: Modifying the application resources.
With ASP.NET developers can take advantage of strongly typed access to resources without the need for firing up a ResourceManager.
The Conversion Revision did the first step for us (moving the resx file into the App_GlobalResources special folder), we now have to modify the code
which uses these resources.
- In Solution Explorer expand the Templates folder.
- Right click ManualLogin.aspx and click View Code.
- Locate line 54
- Replace the right hand side of the operators with the new Resource access syntax. Your code should now be:
LTManualLoginDomain.Text = Resources.WoodgroveNetResource.LoginDomain;
LTManualLoginNTUserName.Text = Resources.WoodgroveNetResource.LoginNTUserName;
LTManualLoginNTPassword.Text = Resources.WoodgroveNetResource.LoginNTPassword;
LTManualLoginRememberCredentials.Text = Resources.WoodgroveNetResource.LoginRememberCredentials;
ManualLoginSubmit.Value = Resources.WoodgroveNetResource.LoginButton;
LTAccessDeniedMessage = Resources.WoodgroveNetResource.AccessDeniedMessage;
LTGeneralExceptionMessage = Resources.WoodgroveNetResource.GeneralExceptionMessage;
LTArgumentOutOfRangeExceptionMessage = Resources.WoodgroveNetResource.ArgumentOutOfRangeExceptionMessage;
LTSSLStatus = Resources.WoodgroveNetResource.LoginHTTPS;
LTSSLWarningMessage = Resources.WoodgroveNetResource.LoginSSLWarning;
We need to do the same for all other uses of the LocalizationResourceManager.
- From the Edit menu click Find and Replace, followed by Find in Files.
- In the Find what text box, enter LocalizationResourceManager and click Find All.
- Use to Find Results pane to navigate to and correct each use of the LocalizationResourceManager.
Note you can optionally comment out or remove all declares and instantiations of the now redundant ResourceManager class.
The benefits of strongly typed access to resources are now apparant as a attempted build will fail, we need to fix the original application by adding an additional resource.
- In Solution Explorer within the App_GlobalResources folder, double click WoodgroveNetResource.resx.
- Add a New String Resource named JobAppInstruction and provide a Value.
You can now build and debug the WoodgroveNet application which is now hosted by ASP.NET 2.0 and can develop it further using SP2 features!
At this stage you may wish to remove now redundant files from the project, such as the individual resx files for each MCMS template.