To deploy applications written with dotConnect for Snowflake, you should register run-time assemblies Devart.Data.Snowflake.dll, Devart.Data.SqlShim.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 three assemblies should be available in all applications written with dotConnect for Snowflake. Activate dotConnect for Snowflake on the target computer, or pass the activation key at run time as described in Activation.
The .NET Framework assembly of the provider includes all the libraries it needs besides Devart.Data.dll and Devart.Data.SqlShim.dll. The .NET Standard 2.0 assemblies depend on the following NuGet packages: Devart.Data.SqlShim uses Newtonsoft.Json, Microsoft.Win32.Registry, Microsoft.Bcl.HashCode, and System.Diagnostics.PerformanceCounter; Devart.Data uses Microsoft.Win32.Registry and System.IO.FileSystem.AccessControl; Devart.Data.Snowflake uses Portable.BouncyCastle, System.IdentityModel.Tokens.Jwt (with the Microsoft.IdentityModel libraries it depends on), and TimeZoneConverter for key-pair authentication and date and time mapping. NuGet installs all of them automatically. If you deploy the assemblies manually, copy these libraries to the folder of your application too: the easiest way is to take them from the output folder of a project that references the Devart.Data.Snowflake NuGet package.
When your code uses dotConnect for Snowflake 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.0.0.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. 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:
- task: CmdLine@2
inputs:
script: '$(Build.SourcesDirectory)\dcsnowflake.exe /TYPE=FULL /VERYSILENT'
|
The /TYPE=FULL parameter selects the full installation with all components, and the /VERYSILENT parameter runs the installation without any windows. For more information about the command line installation keys, see Installation.
When a dotConnect for Snowflake 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 Snowflake 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.
For Entity Framework Core there is no need to register the provider in the machine.config file.