Data Access has been discontinued. Please refer to this page for more information.

How to: Use Telerik® Data Access Without Installing It

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

In this topic you will learn how to integrate the Telerik Data Access Enhancer in MSBuild task. If you have added Telerik Data Access Domain Model via the "Add New Item" command to your project, the enhancement is already added to the MsBuild project file and no changes are necessary. However, this scenario only works if you have Telerik Data Access installed on your build machines.

To integrate the Telerik Data Access Enhancer in MSBuild task:

  1. In Windows Explorer, navigate to your Project folder containing Telerik Data Access Domain Model (.rlinq file). Create a new folder named OpenAccessAssemblies.

  2. Copy the following Telerik Data Access dlls in the OpenAccessAssemblies folder:

    1. ~OpenAccess Installation Folder/sdk/CecilLicense.txt
    2. ~OpenAccess Installation Folder/sdk/enhancer.exe
    3. ~OpenAccess Installation Folder/sdk/enhancer.exe.config
    4. ~OpenAccess Installation Folder/sdk/Mono.Cecil.dll
    5. ~OpenAccess Installation Folder/sdk/Mono.Cecil.Pdb.dll
    6. ~OpenAccess Installation Folder/sdk/OpenAccess.targets
    7. ~OpenAccess Installation Folder/sdk/Telerik.OpenAccess.SDK.dll
    8. ~OpenAccess Installation Folder/sdk/VEnhance.exe
    9. ~OpenAccess Installation Folder/sdk/venhance.exe.config
    10. ~OpenAccess Installation Folder/bin/Telerik.OpenAccess.35.Extensions.dll
    11. ~OpenAccess Installation Folder/bin/Telerik.OpenAccess.Config.dll
    12. ~OpenAccess Installation Folder/bin/Telerik.OpenAccess.dll
    13. ~OpenAccess Installation Folder/bin/Telerik.OpenAccess.Runtime.dll
  3. Open your solution in Visual Studio.

  4. The first step is to modify your project. Right-click on your project in the Solution Explorer and select Unload Project.

  5. Again in the Solution Explorer, right-click on the unloaded project and select Edit {ProjectName}.csproj.

  6. In your csproj file, find a line like this one:

    <Import Condition="Exists('$(MSBuildExtensionsPath)\OpenAccess.targets')" 
            Project="$(MSBuildExtensionsPath)\OpenAccess.targets" />
    

    And replace it with the following (where OpenAccessAssemblies is the name of the folder you've created in step 1):

    <Import Project="OpenAccessAssemblies\OpenAccess.targets" />
    
  7. Save your changes. Right-click on your project in the Solution Explorer and select Reload Project.

  8. The next step is to modify the Telerik Data Access.targets file. In the Solution Explorer, select the Telerik Data Access.targets and open it for edit.

  9. In the file, locate the following lines (at the beginning of the file):

    <PropertyGroup>
        <!-- Additional Data Access related information -->
        <OpenAccessPath Condition="'$(OpenAccessPath)'==''">c:\Program Files\Telerik\OpenAccess ORM</OpenAccessPath>
        <EnhancerAssembly Condition="'$(EnhancerAssembly)'==''">$(OpenAccessPath)\sdk\enhancer.exe</EnhancerAssembly>
        <!-- Additional Data Access related information -->
    </PropertyGroup>
    

    And modify the <PropertyGroup></PropertyGroup> section as shown below:

    <PropertyGroup>
         <!-- Additional Data Access related information -->
         <OpenAccessPath Condition="'$(OpenAccessPath)'==''">OpenAccessAssemblies</OpenAccessPath>
         <EnhancerAssembly Condition="'$(EnhancerAssembly)'==''">enhancer.exe</EnhancerAssembly>
         <!-- Additional Data Access related information -->
    </PropertyGroup>
    
  10. Save the changes. In the end, you need to replace your Telerik Data Access references. By default, when you create a new Telerik Data Access Domain Model, references to the Telerik Data Access assemblies are automatically added. However, those assemblies are located in the Telerik Data Access installation folder. Since you want to build your project on a machine where Telerik Data Access is not installed, you have to modify the Telerik Data Access references. Delete the existing Telerik Data Access references. And add the same again, but this time use the dlls located in the OpenAccessAssemblies folder.

  11. Build the solution to ensure that everything is building successfully.
  12. Close your solution and transfer it to the machine where Telerik Data Access is not installed.
  13. Open your solution again and build it.

When you run your application on a computer where Telerik Data Access is not installed, you have to ensure that the following assemblies are copied to the deployment folder:

  • Telerik.OpenAccess.dll
  • Telerik.OpenAccess.35.Extensions.dll
  • Telerik.OpenAccess.Config.dll
  • Telerik.OpenAccess.Runtime.dll

Using Non-MSSQL Database

In case you want to use a database different than MSSQL, you have to ensure that the corresponding drivers are also deployed on the client computer. For more information, check out the Database Support section.