dotConnect for Salesforce Documentation
In This Topic
    Deployment
    In This Topic

    To deploy applications written with dotConnect for Salesforce you should register run-time assemblies Devart.Data.Salesforce.dll and Devart.Data.dll at Global Assembly Cache (GAC) for appropriate framework or place them in the folder of your application (Bin folder for web projects). These two assemblies should be available in all applications written with dotConnect for Salesforce. Make sure that your project contains the license resource as it is described in Licensing.

    Your application should also have access to the sqlite3.dll library. This library can be located either in the application folder or in a system-wide accessible folder. The bitness (32-bit or 64-bit) of the library must correspond to the bitness of your application.

    Another way to install the needed *.dll is to launch the dotConnect for Salesforce setup program and choose "Minimal installation". Note that according to End-User License Agreement this is the only install you can do on target machine. You must not distribute any other part of dotConnect for Salesforce.

    Applications written with dotConnect for Salesforce may not contain the license resource when they are deployed on the target machine where dotConnect for Salesforce is installed with "Minimal" option.

    When your code uses dotConnect for Salesforce via a factory-based class, you should register configuration information in the DbProviderFactories section of the *.config file to inform your environment about the existence of the provider factory. The provider factory is described either in machine.config (globally), in app.config or in web.config (just for your application), but not in both files. This is done as follows:

    <system.data>
      <DbProviderFactories>
        <remove invariant="Devart.Data.Salesforce" />
        <add name="dotConnect for Salesforce" invariant="Devart.Data.Salesforce" description="Devart dotConnect for Salesforce" type="Devart.Data.Salesforce.SalesforceProviderFactory, Devart.Data.Salesforce, Version=2.4.247.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
      </DbProviderFactories>
    </system.data>
    

    Replace 2.4.247.0 here with your actual version.


    ASP.NET Applications

    If the Data Cache and Metadata Cache connection string parameters are not set, the default folder for the corresponding databases is AppData of the current user. But ASP.NET application does not have an access to this folder. Please set these parameters explicitly and specify the folder, to which your ASP.NET user has the read/write access. For example: "Data Cache=c:\\MyWebApp\\1.db;Metadata Cache=c:\\MyWebApp\\1_metadata.db;".

    Required Permissions

    When dotConnect for Salesforce application is used in partially trusted code (this is actual for web projects), it requires medium trust level.

    Since dotConnect for Salesforce uses standard Microsoft .NET licensing licensing, it additionally requires RegistryPermission. And though SecurityPermission is granted by default when using medium trust level, the set of flags for the SecurityPermission must be extended. You need to add the following flags: Assertion, SkipVerification, UnmanagedCode, and SerializationFormatter.

    For the information on how to do this see Configuring Trust Level for Web Applications.

    Entity Framework and LightSwitch Projects

    When deploying Entity Framework (or LightSwitch) projects, it is necessary to:

    1. First, you need to check if the Devart.Data.Salesforce.Entity.EF<Version>.dll assembly is available for your application. The <Version> here is the version of Entity Framework used in your application. For Entity Framework v1 the assembly is called Devart.Data.Salesforce.Entity.EF1.dll, for Entity Framework v4 and v5 it is Devart.Data.Salesforce.Entity.EF4.dll, for Entity Framework v6 it is Devart.Data.Salesforce.Entity.EF6.dll. For Entity Framework Core it is Devart.Data.Salesforce.Entity.EFCore.dll. The assembly should reside in the application's folder or in GAC.

      Please note that there are three versions of Devart.Data.Salesforce.Entity.EFCore.dll assemblies for different Entity Framework Core versions - 1.1, 2.2, and 3.1. They are located respectively in \Entity\EFCore, \Entity\EFCore2, and \Entity\EFCore3 subfolders of the dotConnect for Salesforce installation folder.

    2. Inform your environment about the provider factory existence (add the entry to the DbProviderFactories section as it is described above).

    You can find this assembly in the Entity folder in the provider installation folder, in the subforder, corresponding to the Entity Framework version necessary.

    If you are registering the provider in the machine.config file, please take into account the Entity Framework version. Entity Framework v1 - specific applications require an entry in the .NET Framework 2.0 configuration file, and Entity Framework v4 and later - specific applications should be registered in the .NET Framework 4.0 configuration file. For Entity Framework Core there is no need to register the provider in the machine.config file.

    You can also read Microsoft's Deployment Considerations on ADO.NET Entity Framework.

    Deploying LightSwitch applications is described here.