To deploy applications written with dotConnect for DB2, you should register run-time assemblies Devart.Data.DB2.dll and Devart.Data.dll in the Global Assembly Cache (GAC) for the 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 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 files is to launch the dotConnect for DB2 setup program and choose "Minimal installation". Note that, according to the End-User License Agreement, this is the only installation you can do on the 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 the "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). This is done as follows:
Replace 1.6.127.0 here with your actual version.
If you set up a pipeline for compiling your source code from a repository on a build server periodically or even after every commit, you should add a step to your pipeline for installing the provider on the build server, copying Devart.* assemblies, registering the provider build action, and enabling automatic generation of the .NET Framework license resource from the provider entry in licenses.licx. For example, the corresponding step in Azure DevOps Pipeline can be the following one if you copied the provider installation to the root folder of your repository:
For more information about the command line installation keys, see Installation.
When deploying ASP.NET applications, the following additional assemblies may be needed:
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 a dotConnect for DB2 application is used in a partially trusted environment (which may apply to certain ASP.NET applications), it requires at least medium trust.
Since dotConnect for DB2 uses standard Microsoft .NET licensing, it additionally requires RegistryPermission. Although SecurityPermission is granted by default at the medium trust level, the set of flags for SecurityPermission must be extended. You need to add the following flags: Assertion, SkipVerification, UnmanagedCode, and SerializationFormatter.
For information on how to do this, see Configuring Trust Level for Web Applications.
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 the GAC.
Please note that there are three versions of Devart.Data.DB2.Entity.EFCore.dll assemblies for Full .NET Framework, 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 DB2 installation folder.
You can find these assemblies in the Entity folder in the provider installation folder, in the subfolder corresponding to the necessary Entity Framework version.
If you are registering the provider in the machine.config file, please take into account the Entity Framework version. Applications that use Entity Framework v1 require an entry in the .NET Framework 2.0 configuration file, and applications that use Entity Framework v4 and later 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.