VistaDB 6
VistaDB / Getting Started / Using VistaDB with Entity Framework / Deploying VistaDB with your Application
In This Topic
    Deploying VistaDB with your Application
    In This Topic

    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.  All of the libraries used by VistaDB are distributed as NuGet packages, installed in the Packages folder of the VistaDB installation, typically:

    C:\Program Files (x86)\Gibraltar Software\VistaDB 6\Packages
    

    Additionally, there are redistributable tools useful in certain scenarios located in a Redist folder in the VistaDB installation, typically:

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

    All of the assemblies in the Packages and Redist folders 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.

    Package Assembly Description Usage
    VistaDB.6 VistaDB.6.dll The core ADO.NET Engine This file is always required - it is the primary database engine for VistaDB
    VistaDB.6.Entity.4 VistaDB.6.Entity.4.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.6.Entity.6 VistaDB.6.Entity.6.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.6.Loupe VistaDB.6.Loupe.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.6.Web VistaDB.6.Web.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.
    (None) DataMigrationWizard.exe Data migration tool Located in the Redist folder, 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.
    Package Assembly Description Usage
    VistaDB.6 VistaDB.6.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.vdb6'" 
             providerName="System.Data.VistaDB6" />
      </connectionStrings>
      <system.data>
        <DbProviderFactories>
          <remove invariant="System.Data.VistaDB6" />
          <add invariant="System.Data.VistaDB6" name="VistaDB 6 Data Provider" 
               description="VistaDB 6 ADO.NET Provider for .Net"
                type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.6" />
        </DbProviderFactories>
      </system.data>
    </configuration>
    

    The connection string in the example above specifies a providerName of "System.Data.VistaDB6".  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.

    Here is the DbProviderFactory setting:

    <add invariant="System.Data.VistaDB6" name="VistaDB 6 Data Provider" 
          type="VistaDB.Provider.VistaDBProviderFactory, VistaDB.6" />
    

    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