Although the Enterprise Library includes binaries for all the source code, you may want to customize the source code. This means you will need to build the Enterprise Library yourself. The following sections describe how to do this. After you have the binaries, you may want to strong-name them. For more information about this topic, see Strong Naming the Enterprise Library Assemblies.
This topic contains the following subsections:
Installing the Source Code
You can install all the Enterprise Library source code using the Source Code Installer. When you run the installer, you can choose to install application blocks, QuickStarts, or both.
To run the Source Code Installer
- Click Start, point to Programs, point to Microsoft patterns & practices, and then click Enterprise Library 4.1 – October 2008.
- Choose Enterprise Library Source Code Installer, and then follow the instructions.
Library Visual Studio Solution Files
The Enterprise Library source code contains several Visual Studio projects. Enterprise Library includes multiple Visual Studio 2008 solution files (and, for the Unity Application Block, a Visual Studio 2005 solution file). Three of the solution files contain projects for the Enterprise Library Core and all the application blocks, minus certain projects that have non-standard dependencies (see the following notes). You can use these solution files to build the entire Enterprise Library or to create solution files that contain only the projects you want to build. When you build the Enterprise Library, the Core and Configuration Console are built automatically. The EnterpriseLibrary.sln solution file contains the entire set of application block projects, Enterprise Library Core projects, and the Configuration Console. It also includes all unit tests for execution with Visual Studio Team System.
In addition, there is a solution file for each application block that includes Visual Studio Team System unit tests. The application block solution files contain all the projects, including the provider projects, for the application block. They also contain the configuration design-time projects. The configuration design-time assemblies are required for executing the Configuration Console, but they are not required for deploying or executing applications.
Note: |
The Security Application Block includes an authorization provider for Authorization Manager (AzMan). This provider requires AzMan to be installed and also requires the interop assembly, Microsoft.Interop.Security.AzRoles.dll. The Enterprise Library solution file does not contain the run-time projects and design-time projects for the AzMan authorization provider. If you want to compile the AzMan provider projects, you can modify the Enterprise Library solution files or you can use the Security Application Block solution files.
Similarly, the Enterprise Library solution files do not contain the following projects: ExceptionHandling.WCF, Validation.Integration.WCF, and Data.SqlCe. These projects can be found in their respective solution files. |
Build Configurations
The Enterprise Library solution files include two build configurations: Release and Debug. All projects within a solution file, including the unit test projects, are compiled in both configurations.
Building the Enterprise Library Application Blocks and Tools
There are two ways to build the Enterprise Library application blocks and tools. You can use either batch files or Visual Studio solution files. The following sections describe these two options.
Building the Enterprise Library Using Batch Files
When you install the Enterprise Library source code, the installation program installs several batch files in the source code folder. These batch files include the following:
- BuildLibrary.bat. This file compiles all application blocks and tools. When launched with no parameters, it builds a Debug version of the application blocks and tools. It accepts one parameter to indicate an alternative build type, such as a Release build.
- CopyAssemblies.bat. This file copies the assemblies to the bin directory. When launched with no parameters, it copies the Debug assemblies to the INSTALLDIR\Program Files\Microsoft Enterprise Library\bin directory. It accepts two parameters. The first parameter indicates an alternative build type, and the second parameter indicates the destination directory where the assemblies will be copied.
- BuildLibraryAndCopyAssemblies.bat. This file sequentially executes BuildLibrary.bat and CopyAssemblies.bat.
Building Enterprise Library Using Visual Studio Solution Files
You can also use Visual Studio to compile the Enterprise Library application blocks and tools. In Visual Studio, open the EnterpriseLibrary.sln solution file. On the Build menu, click Build Solution. The solution files include the entire set of projects for the application blocks, optional providers, common assemblies, and tools.
The solution files do not copy the assemblies to the bin directory. You can run the batch file CopyAssemblies.bat to copy the assemblies to the source folder bin directory.
Note: |
| To install the instrumentation schema, you can run the InstallServices.bat batch file included in the source folder after you install the source code. |
Additional Notes for Building and Using the Source Code
The following are some additional points about building the Enterprise Library:
Building the QuickStart Applications
The QuickStart projects are not included in the Enterprise Library solution files. Each QuickStart has a solution file that includes the QuickStart projects and all required application block projects. To build a QuickStart, open the appropriate QuickStart solution file in Visual Studio, and then click Build Solution on the Build menu.