Sponsored

Showing posts with label WCSF. Show all posts
Showing posts with label WCSF. Show all posts

Wednesday, June 24, 2009

ASP.NET user name availability check using WCSF Validation Bundle

An average web site offering membership and protected content for its members requires users to sign up by visiting a sign-up or register page that allows a user to enter some information and create an account. A couple of pieces if information that users are commonly asked to enter are a User name or Login name and user's email. One potential problem with such user input is checking that entered login name and/or email address are available for registration and haven't been used by other users. When it's the case multiple attempts of entering available values can be very annoying and frustrating for users even making them to refuse registration on a web site. So improving user experience when validating login name and email is quite an important task.

Friday, May 1, 2009

Enabling a WCSF solution for sub-Web Application Project

If in your Web Client Software Factory (aka WCSF) solution you use Web Application Project (as opposed to Web Site Project) for your web site you are able to use a so called sub-Web Application Project in order to further modularize your web application.

If you created a WAP WCSF solution from scratch this option will be available. If, however, you converted your Web Site WCSF solution to WAP WCSF solution or upgraded from the previous version of WCSF this option may not appear when you are trying to add a new business module to your solution.

Visibility of the "Create as sub-Web Application Project" checkbox depends on one single property of a solution file and if you don't see the checkbox open the .sln file with any text editor and check out that it contains the follwoing content:


  GlobalSection(ExtensibilityGlobals) = postSolution
  ...
  IsWCSFSolutionWAP = True
  ...
  EndGlobalSection

Usually this section is located in the bottom of a .sln file and the red line is the key to solving the problem. If you don't see the line in your solution file simply add it and reload the solution in Visual Studio. Problem solved.

Tuesday, May 6, 2008

Upgrading your WCSF solution from June 2007 release to Feb 2008 release

You need to start from reading the original WCSF Wiki post describing how to perform an upgrade from the previous June 2007 release to the latest Feb 2008 release. In a nutshell there are a few steps that you will need to do:
  1. Install .NET Framework 3.5
  2. Remove WCSF June 2007 release
  3. Upgrade your Guidance Automation software from any earlier release to the Feb 2008 for VS 2008 release
  4. Install WCSF Feb 2008 release
  5. Load your solution in VS2008 and make all the necessary changes.
That's a plan. Most if those steps are straight-forward and don't require additional explanations especially with the help of the original WCSF upgrade instructions. However there are a few tricky moments I'd like to focus on.
  1. When you remove the older Guidance Automation remember the following two rules:
    • First remove all the Guidance Automation packages installed on your machine;
    • Remove first the Guidance Automation Toolkit for VS and then remove Guidance Automation Extensions.
    If you happened to see an exception saying that some Guidance Automation Packages are still not removed while trying to uninstall the Guidance Automation Extensions you need to remove references to those packages first in order to be able to successfully uninstall Guidance Automation Extensions. Go to the Documents and Settings\..\Application Data\Microsoft\Recipe Framework folder and find a RecipeFramework*.xml file. Open it with a text editor and remove the content between GuidancePackages open and closing tags. Now you'll be able to uninstall Guidance Automation Extensions.
  2. After you installed WCSF Feb 2008 you'll need to enable it for your solution. It's done through the Visual Studio Guidance Automation Manager plug-in. The only thing that I'd recommend is to change a content of a vwd.webinfo file in the root fo your web site first because it differs for WCSF Feb 2008 comparing to WCSF July 2007. Make sure that the content of the vwd.webinfo looks like it's described here.
  3. Now you're ready to modify your code and here are the list of mandatory changes that you'll need to do in order to make your application working:
    • Remove the references to the previous WCSF assemblies from all your projects (basically they are foundation modules, business modules and web sites) and add the references to the WCSF Feb 2008 assemblies. Pay attention that there is no more such an assembly as Microsoft.Practices.ObjectBuilder.WCSFExtensions as it is merged into Microsoft.Practices.CompositeWeb.ObjectBuilder
    • Modify all the [ModuleName]ModuleInitializer.cs files: in the ModuleInitializer Load method, use the concrete class CompositionContainerinstead of ICompositionContainer.
    • Modify all the Pages code behind .cs files: a Presenterproperty now has both getter and setter methods and a setter method pattern is a bit different as shown below:
      [CreateNew]
      public [ViewName]Presenter Presenter
      {
          get { return presenter; }
          set
          {
              if (value == null)
                  throw new ArgumentNullException("value");
      
              presenter = value;
              presenter.View = this;
          }
      }
      And also a page base class now should derive from a WCSF base class as shown below:
      public partial class [Module]_[View] : 
      	Microsoft.Practices.CompositeWeb.Web.UI.Page, I[View]
    • Optionally if you used a solution from WCSF_Contrib project for User controls then you'll have to alter those controls the same way as your pages.
So that's basically all. It does not look hard and should not take much of your time. But if you happened to have troubles feel free to post a comment here and I'll try to answer.

Thursday, May 1, 2008

Adding a Web Site to a WCSF solution

WCSF stands for Web Client Software Factory

Whether you are adding a new Web Site to an existing WCSF solution or trying to enable WCSF for an existing solution make sure that a "vwd.webinfo" file is located in the root of a Web Site folder. The Web Site won't be recognized by WCSF's recipes unless there is a "vwd.webinfo". If you already have a Web Site in your solution just copy the file to the root folder of a new web site. If you can't find the file just create the one. Here is how its content should look like:

<?xml version="1.0" encoding="UTF-8"?>
<visualwebdeveloper>
 <globals>
      <userproperties iswebproject="true">
 </globals>
</visualwebdeveloper>

Friday, February 29, 2008