Telerik Data Access uses Enhancer, which is a special enhancer program, to read and process compiled .NET assemblies for adding persistence capability. The Enhancer can be called from the command line, but normally the enhancer is called directly by Visual Studio during build time to process the .NET assemblies in your project. The Enhancer injects the lazy loading and change tracking code into your persistent classes and replaces the read and write calls to persistent fields. Enhancement must be executed on all assemblies containing persistent classes or code that touches public fields of persistent objects. If you have used one of the Telerik Data Access wizards to configure your project, the enhancement is already configured and everything runs out of the box. Nevertheless, it is sometimes necessary to understand how the enhancer is called. Especially to integrate the enhancer into an automatic build process. The enhancer has to collect all the mapping information for the assembly that you want to enhance and the referenced assemblies which contain persistent classes as well. Telerik Data Access has two mechanisms to define the mapping - either XML only or CLR Attributes only.
Telerik Data Access calls Enhancer as a post-build step. However, if you have specified any post-build events in your visual studio properties, first those events will be called followed by the call to the Enhancer.
If you have added Telerik Data Access Domain Model via the "Add New Item" to your project, the enhancement is already added to the MsBuild project file and no changes are necessary. In the project properties, Enhancing must be False. But it only works if you have Telerik Data Access installed on your build machines. To make it possible for your project to work without Telerik Data Access installed, you have to modify the project. For more information, please refer to the How to: Use Telerik Data Access Without Installing It topic.