-
-
Notifications
You must be signed in to change notification settings - Fork 45
Configuration
This wiki page documents the configuration settings available for the System.Data.SqlLocalDb.dll
assembly.
As well as a custom configuration section that can be included in the application configuration file, two legacy appSettings
values that existed in versions of the assembly prior to v1.13.0.0 are still supported for backwards compatibility.
An example of an application configuration file containing the custom configuration section with all the values configured to their default values is shown below.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="system.data.sqlLocalDb" type="System.Data.SqlLocalDb.Configuration.SqlLocalDbConfigurationSection, System.Data.SqlLocalDb" />
</configSections>
<system.data.sqlLocalDb
automaticallyDeleteInstanceFiles="false"
overrideVersion=""
stopOptions="None"
stopTimeout="00:01:00"
/>
</configuration>
The configuration attributes of the custom system.data.sqlLocalDb
configuration section are documented below. If the custom configuration section is not defined or present in the application configuration file, the default values documented below (and shown in the configuration file example above) are used.
Type: bool
Default: false
Specifies whether to automatically delete the files associated with SQL LocalDB instances when they are deleted. The default behavior is to leave these files on disk as this is the default behavior of the SQL LocalDB Instance API.
Enabling this setting will cause the assembly to delete all files stored in %LOCALAPPDATA%\Microsoft\Microsoft SQL Server Local DB\Instances
that are associated with the SQL LocalDB instance being deleted.
Type: string
Default: ""
The override version string of the native SQL LocalDB API to load, if any. The default behavior is to always load the latest version of the SQL Server LocalDB API installed on the local computer.
As the SQL LocalDB Instance API native DLL is loaded into the process' memory when first used and is not unloaded again until the process terminates this setting can only be controlled through the application configuration file.
Type: System.Data.SqlLocalDb.StopInstanceOptions
Default: StopInstanceOptions.None
The options to use when stopping instances of SQL LocalDB.
The StopInstanceOptions
enumeration specified the [System.Flags]
attribute, so the values can be combined by specifying multiple values separated by a comma ','
, for example: stopOptions="KillProcess, NoWait"
.
Supported values are:
-
StopInstanceOptions.KillProcess
(maps to theLOCALDB_SHUTDOWN_KILL_PROCESS
flag in the native API). -
StopInstanceOptions.NoWait
(maps to theLOCALDB_SHUTDOWN_WITH_NOWAIT
flag in the native API).
Type: System.TimeSpan
Default: 00:01:00
(1 minute)
The default timeout used to wait for SQL LocalDB instances to stop. Whilst this setting is a TimeSpan, the resolution of the value is only used to a granularity of seconds.
The two legacy application configuration settings that are supported for backwards compatibility are documented below.
These settings are honored if the setting that supersedes it in the system.data.sqlLocalDb
custom configuration section has not been explicitly set.
This setting has been superseded by the /configuration/system.data.sqlLocalDb/@automaticallyDeleteInstanceFiles
configuration attribute.
This setting has been superseded by the /configuration/system.data.sqlLocalDb/@overrideVersion
configuration attribute.