To deploy applications written with dotConnect for DB2 you should register run-time assemblies Devart.Data.DB2.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 DB2. Make sure that your project contains the license resource as it is described in Licensing. Additionally you need to deploy the IBM.Data.DB2.dll IBM DB2 .NET Data Provider library.
Another way to install the needed *.dll is to launch the dotConnect for DB2 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 DB2.
Applications written with dotConnect for DB2 may not contain the license resource when they are deployed on the target machine where dotConnect for DB2 is installed with "Minimal" option.
When your code uses dotConnect for DB2 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.DB2" /> <add name="dotConnect for DB2" invariant="Devart.Data.DB2" description="Devart dotConnect for DB2" type="Devart.Data.DB2.DB2ProviderFactory, Devart.Data.DB2, Version=184.108.40.206, Culture=neutral, PublicKeyToken=09af7300eec23701" /> </DbProviderFactories> </system.data>
Replace 220.127.116.11 here with your actual version.
When deploying ASP.NET applications, the following additional assemblies may be needed:
- Devart.Data.DB2.Web.dll - in case if the DB2DataSource component or ASP.NET providers are used;
- App_Licenses.dll - if the application is a non-precompiled web site.
When deploying ASP.NET applications using ADO.NET implementation of ASP.NET Identity via dotConnect for DB2, you need to deploy the Devart.Data.DB2.Web.Identity.dll assembly.
When deploying ASP.NET applications using Entity Framework implementation of ASP.NET Identity via dotConnect for DB2, you need to deploy the Devart.Data.DB2.Entity.EF6.dll assembly. It is located in the Entity\EF6 subfolder of the dotConnect for DB2 installation folder.
When dotConnect for DB2 application is used in partially trusted code (this is actual for web projects), it requires medium trust level.
Since dotConnect for DB2 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 ProjectsWhen deploying Entity Framework (or LightSwitch) projects, it is necessary to:
First, you need to check if the Devart.Data.DB2.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.DB2.Entity.EF1.dll, for Entity Framework v4 and v5 it is Devart.Data.DB2.Entity.EF4.dll, for Entity Framework v6 it is Devart.Data.DB2.Entity.EF6.dll. For Entity Framework Core it is Devart.Data.DB2.Entity.EFCore.dll. The assembly should reside in the application's folder or in GAC.
Please note that there are two versions of Devart.Data.DB2.Entity.EFCore.dll assemblies - for Entity Framework Core 1.1 and for Entity Framework Core 2.0. The first is located in the \Entity\EFCore subfolder of the dotConnect for DB2 installation folder, and the second one - in the \Entity\EFCore2 subfolder.
- If you use Code-First Migrations feature of Entity Framework v4 or Entity Framework v5, you also need to check if the Devart.Data.DB2.Entity.Migrations.EF4.dll assembly is available for your application. For Entity Framework v6 this assembly is not needed.
- Inform your environment about the provider factory existence (add the entry to the DbProviderFactories section as it is described above).
You can find these assemblies 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.