VistaDB 5
Gibraltar VistaDB > Getting Started > Using VistaDB with Entity Framework > Deploying VistaDB with your Application
Deploying VistaDB with your Application

Redistributing VistaDB with your product is very easy - just place the appropriate runtime Dll(s) in the same directory as your executable (or in the bin folder of your web project).  We don't recommend using the GAC unless absolutely required by your application.  You can find a complete set of the redistributable files for VistaDB in:

C:\Program Files (x86)\Gibraltar Software\VistaDB 5\Redist

Under the Redist directory are subdirectories for .NET 2.0 and .NET 4.0 specific versions that in turn contain all of the files that you can redistribute with your application.  All of the assemblies in the Redist folder can be redistributed at no cost.  You may not include the Visual Studio Designer DLL's, or the Data Builder. See the EULA for more information.

Assembly Description Usage
VistaDB.5.NET40.dll The core ADO.NET Engine This file is always required - it is the primary database engine for VistaDB
VistaDB.5.Entity.4.NET40.dll The Entity Framework 4.x and 5.x Provider When using Entity Framework 4.0 through 5.x this assembly must be in the same directory as the core ADO.NET engine
VistaDB.5.Entity.6.NET40.dll The Entity Framework 6.0 Provider When using Entity Framework 6.0 or later this assembly must be in the same directory as the core ADO.NET engine.
VistaDB.5.Loupe.NET40.dll Loupe Logging provider for VistaDB If you want to gather diagnostic data from the VistaDB provider while your application runs this assembly will connect it with Loupe, a free diagnostic and logging tool provided by Gibraltar Software.
VistaDB.5.Web.NET40.dll ASP.NET Membership provider for VistaDB If you are using the VistaDB membership provider redistribute this assembly in the Bin folder of your web site.
DataMigrationWizard.exe Data migration tool If you want to perform migrations from third party databases to VistaDB in the field you can redistribute this application.  It must be in the same directory as the VistaDB engine and depends on the Gibraltar.Agent.dll and Loupe Logging provider for VistaDB.
Assembly Description Usage
VistaDB.5.NET20.dll The core ADO.NET Engine This file is always required - it is the primary database engine for VistaDB
VistaDB.5.Loupe.NET20.dll Loupe Logging provider for VistaDB If you want to gather diagnostic data from the VistaDB provider while your application runs this assembly will connect it with Loupe, a free diagnostic and logging tool provided by Gibraltar Software.
VistaDB.5.Web.NET20.dll ASP.NET Membership provider for VistaDB If you are using the VistaDB membership provider redistribute this assembly in the Bin folder of your web site.
Assembly Description Usage
VistaDB.5.Android.dll The core ADO.NET Engine This file is always required - it is the primary database engine for VistaDB
Assembly Description Usage
VistaDB.5.iOS.dll The core ADO.NET Engine This file is always required - it is the primary database engine for VistaDB

Registering VistaDB with ADO.NET

In nearly every application that uses VistaDB you will need to register the VistaDB Engine with ADO.NET so that it can be found when using Entity Framework or Typed DataSets.  This is done through the configuration file for the application.  For executables (like WinForms applications, console applications, and services) this is a file called app.config in the root directory of your project.  For Web sites it's called web.config. 

App.Config with VistaDB Provider Factory
Copy Code
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <add name="YourAppConnection" 
         connectionString="Data Source='|DataDirectory|\Database.vdb5'" 
         providerName="System.Data.VistaDB5" />
  </connectionStrings>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.VistaDB5" />
      <add invariant="System.Data.VistaDB5" name="VistaDB 5 Data Provider" 
           description="VistaDB 5 ADO.NET Provider for .Net"
            type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.5.NET40" />
    </DbProviderFactories>
  </system.data>
</configuration>

The connection string in the example above specifies a providerName of "System.Data.VistaDB5".  This is then resolved in the list of DbProviderFactories by looking for an entry with a matching "invariant" name.  When it finds a match it will then load the type specified by the provider factory and ask it to create all of the various objects it needs for data access.

If you are using VistaDB.5.NET40 (recommended for .NET 4.0 and later applications) use this DbProviderFactory setting:

<add invariant="System.Data.VistaDB5" name="VistaDB 5 Data Provider" 
      type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.5.NET40" />

If you are using VistaDB.5.NET20 (for supporting .NET 2.0 - .NET 3.5 applications) use this DbProviderFactory setting:

<add invariant="System.Data.VistaDB5" name="VistaDB 5 Data Provider" 
      type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.5.NET20" />

Additional Configuration for Entity Framework

If your application uses Entity Framework see Using VistaDB with Entity Framework - Registering the Provider for additional configuration necessary to register the EF provider with your application.

Maintaining Deployed Databases

Once you've shipped your application and are storing real data in it, you want to be sure to keep that data safe and accessible.  Follow our suggestions on Database Maintenance to be prepared for whatever can happen in the real world.  Taking a little time up front can save a great deal of support time and customer satisfaction later.

See Also