This project is read-only.

How to: Create a Foundational Module

Foundational modules are units of development and deployment that encapsulate infrastructure services. They do not contain Web pages nor do they have a module composition container. An example of a foundational module could be a module that contains services, such as logging and authorization services.
This topic describes how to use the Add Foundational Module template to generate a foundational module.


The Add Foundational Module recipe assumes that you have an existing Web client solution. For information about how to create a Web client solution, see How to: Create a Web Client Solution.
The Add Foundational Module recipe applies to the Visual Studio solution folder (typically, this is the Modules solution folder).


The following procedure describes how to use the recipe to create a foundational module.

To use the Add Functional Module recipe to create a foundational module
  • In Solution Explorer, right-click a solution folder, point to Web Client Factory, and then click Add Foundational Module (C#) or Add Foundational Module (Visual Basic), as shown in Figure 1.
Figure 1
The Add Foundational Module recipe menu.
  • (Optional) In the Add New Project dialog box, illustrated in Figure 2, change the name of the project in the Name box and the location of the project in the Location box.
Figure 2
The Add Foundational Module project template.
  • Click OK. The recipe starts the Add Foundational Module Wizard. Figure 3 illustrates the first page of the wizard.
Figure 3
The Add Foundational Module recipe wizard.
  • Under Web site in the left pane, click the Web site with a Web.config file that is to be used to define the module.
  • (Optional) If you want a test project for the module to be created with test classes for your module components, select the Create project for unit tests check box.
  • (Optional) If you want to see a summary of the recipe actions and suggested next steps after the recipe completes, select the Show documentation after recipe completes check box.
  • Click Finish. The recipe generates the foundational module.


As illustrated in Figure 4, you will have the following elements in your solution:
  • A C# class library project. This is the module class library. It contains a module initialization class and an empty folder named Services.
  • (Optional) A test project for the module. This is an empty project that you can use to create your unit tests.
  • An updated Web.config file. The module definition will be added to the <modules> section of the Web.config file of the selected Web site. The Composite Web Application Block uses this information to load the module when the application starts.
Figure 4
Web Client Solution with a foundational module Module1.

Next Steps

After you run the Add Foundational Module recipe, you are ready to perform one of the following steps:
  • Implement services. Services are components that provide application or infrastructure logic.
  • Registers the services as global services. To register global services, you add them to the root composition container. For more information related to registering and using services, see How to: Register and Use Services.

Last edited Nov 20, 2007 at 2:21 PM by ejadib, version 4


No comments yet.