First release.
Adds logging, improvements to help use with EntityFramework and new interfaces to help with mocking/abstractions.
Added overloads to support specifying the name of the Initial Catalog using the ISqlLocalDbInstance.GetConnectionForModel() and ISqlLocalDbInstance.GetConnectionStringForModel() extension methods.
- Added new extension methods to make creating and working with connection strings easier. Specifically these are:
DbConnection ISqlLocalDbInstance.GetConnectionForDefaultModel()DbConnection ISqlLocalDbInstance.GetConnectionForDefaultModel(string initialCatalog)DbConnectionStringBuilder ISqlLocalDbInstance.GetConnectionStringForDefaultModel()DbConnectionStringBuilder ISqlLocalDbInstance.GetConnectionStringForDefaultModel(string initialCatalog)string DbConnectionStringBuilder.GetInitialCatalogName()
- Added the following new members:
void DbConnectionStringBuilder.SetInitialCatalogName(string)SqlConnectionStringBuilder ISqlLocalDbInstance.CreateConnectionStringBuilder()ISqlLocalDbInstance ISqlLocalDbProvider.GetOrCreateInstance(string)
- Fixed
SqlLocalDbProvider.GetInstances()only ever returning the default instance. - Added sample application that shows use of the assembly with EntityFramework.
- Added the following new members:
string DbConnectionStringBuilder.GetPhysicalFileName()void DbConnectionStringBuilder.SetPhysicalFileName(string)
- Changes to have the managed code automatically use the native library with the appropriate bitness for the executing processor architecture.
- Fixed typo in XML documentation.
- Improvements to build automation.
- Updated to the latest versions of EntityFramework and Moq.
- The non-core projects now target .NET Framework 4.5.1.
- Removed processor-specific native code from the solution. All native dependencies are now only those related to SQL LocaDB itself. This means the wrapper now ships as a single .NET assembly (
System.Data.SqlLocalDb.dll) which is compiled as AnyCPU. - Added ability to control the behaviour when shutting down a SQL LocalDB instance using the new
StopInstanceOptionsenumeration via theSqlLocalDbApi.StopOptionsproperty and theSqlLocalDbApi.StopInstance(string, StopInstanceOptions, TimeSpan)method overload.
- Support for Microsoft SQL LocalDB 2014.
- Added functionality to the
SqlLocalDbProviderclass to allow the version used to create instances to be changed easily via the newVersionproperty. - Added the
DeleteUserInstances()method to theSqlLocalDbApiclass to allow throw-away instances on the local machine to be easily cleaned-up. - The
SQLLocalDB:OverrideVersionapplication setting can now be used to override the version of the SQL LocalDB native API loaded, instead of the default behaviour of loading the latest version installed on the local machine.
- Fixed
SqlLocalDbApi.ShareInstance()not passing the marshalled value forownerSidto the underlying native LocalDB API function. - Fixed
SqlLocalDbApi.LatestVersionreturning the oldest version number, not the latest version, when SQL LocalDB 2012 and 2014 are installed on the same machine. - Fixed incorrect trace event Id being used if an SQL LocalDB instance was successfully deleted.
- Fixed typo in resource string.
- FxCop and SecAnnotate fixes to NativeMethods for targeting .NET 3.5 and .NET 4.0.
- Added new
TemporarySqlLocalDbInstanceclass which helps manage temporary instances used for a limited period of time, such as for testing purposes. The instances created by this class are automatically started and are deleted when the instances are the class are disposed. - Added the
Restart()convenience extension method to theISqlLocalDbInstanceinterface.
- Added the ability to change the logging implementation by setting an
ILoggerinstance via theLogger.SetLogger(ILogger)method. - The assembly no longer directly references the System.Data.Entity assembly, and now creates the types used from it using reflection instead.
SqlLocalDbApi.DeleteUserInstances()now ignores any errors caused by instances that cannot be deleted because the instance is in use.
- Changed some log messages to use "Obtaining"/"Obtained" instead of "Getting"/"Obtained".
- Fixed two log messages with quoted format values that only had a start quote and no end quote.
- Added the following new members to the
SqlLocalDbApiclass to allow the files associated with a SQL LocalDB instance to be deleted when the instance is deleted. The previous behaviour is retained when using the existing deletion methods. The default value of theSqlLocalDbApi.AutomaticallyDeleteInstanceFilesproperty can be overridden using theSQLLocalDB:AutomaticallyDeleteInstanceFilesapplication configuration setting.bool SqlLocalDbApi.AutomaticallyDeleteInstanceFilesvoid SqlLocalDbApi.DeleteInstance(string instanceName, bool deleteFiles)int SqlLocalDbApi.DeleteUserInstances(bool deleteFiles)
- Added
SqlLocalDbApi.GetInstancesFolderPath()method to obtain the path to which the SQL LocalDB instance files are stored on the local machine for the current user.
- Small change to P/Invoke calls that receive strings as output parameters.
- Fixes to some XML documentation comments.
- Added the following new members to the
TemporarySqlLocalDbInstanceclass to make managing the files for temporary instances easier.TemporarySqlLocalDbInstance .ctor(string instanceName, ISqlLocalDbProvider provider, bool deleteFiles)TemporarySqlLocalDbInstance Create(bool deleteFiles)
- Fixed code path where the value of the
SqlLocalDbApi.AutomaticallyDeleteInstanceFilesproperty was not honoured when deleting instances.
- Added new
system.data.sqlLocalDbcustom configuration section. The settings are documented in the wiki. - Added static
DefaultInstanceNameproperty to theSqlLocalDbApiclass. - Added
GetDefaultInstance()extension method for theISqlLocalDbProviderinterface. - All references to CodePlex in the source code have been updated to GitHub.
- Fixed inability to create the default named instances of SQL LocalDB (i.e.
v11.0orMSSQLLocalDB). - Fixed the
GetOrCreateInstance()extension method for theISqlLocalDbInstanceinterface not being able to correctly determine if the instance already exists if the instance name is one of the default instance names. - Fixed directory traversal flaw in the internal
SqlLocalDbApi.DeleteInstanceFiles(string)method. This was not exploitable by the public API as the native SQL LocalDB Instance API rejects calls toLocalDBDeleteInstance()with such names soDeleteInstanceFiles()was never called. - The path to the native SQL LocalDB Instance API DLL read from the registry is now canonicalized using
System.IO.Path.GetFullPath()before being used.
- Added support for specifying a custom
ILoggerimplementation to use in the application configuration file. - Added new
LanguageIdproperty to theSqlLocalDbApiclass to allow integrators to override the default behaviour used to select the language used to format error messages from the SQL LocalDB Instance API. - Added
en-GBresources.
- Fixed the HRESULT in an exception message not being formatted in hexadecimal.
- Fixed some incorrect XML documentation.
- The assembly now targets .NET 4.0 instead of .NET 3.5 SP1.
- The HRESULT values from the SQL LocalDB Instance API logged in error messages are now formatted as hexadecimal values.
- A warning is logged if the configured version of the SQL LocalDB Instance API to load instead of the latest version cannot be found.
- Fixed
TemporarySqlLocalDbInstanceso it no longer throws an exception when disposed if the temporary SQL LocalDB instance could not be stopped or deleted. - The internals now use the Windows
LoadLibraryExfunction instead ofLoadLibrary.
- The NuGet package name is now
MartinCostello.SqlLocalDb. - Types are now in the
MartinCostello.SqlLocalDbnamespace. - Core classes and interfaces are now:
ISqlLocalDbApiISqlLocalDbInstanceInfoISqlLocalDbInstanceManagerISqlLocalDbVersionInfoSqlLocalDbApiSqlLocalDbExceptionSqlLocalDbInstanceManagerSqlLocalDbOptionsTemporarySqlLocalDbInstance
- Various methods on previous classes and interfaces are now extension methods.
- Configuration is now via the
SqlLocalDbOptionsclass for use with theSqlLocalDbApiclass. - Uses .NET Standard logging abstractions for logging rather than
TraceSource. - Now compiled using the .NET Core SDK.
- Tests now use xunit instead of MSTest.
- Added new
bool InstanceExists(string)method toISqlLocalDbApi. - Add support for registration with the built-in ASP.NET Core service container.
- Added new sample Todo list ASP.NET Core web application that uses SQL Server LocalDB.
- Continuous integration using Travis CI for Linux and macOS.
- Continuous integration using Azure Pipelines for Windows, Linux and macOS.
- Improved behaviour when testing for the existence of LocalDB instances.
- The SQL Server LocalDB Instance API can now be unloaded from the process.
- Logging now uses structured logging and specific event IDs.
- Several types now override
ToString()to return object names. - Improved behaviour if used in an application on Linux or macOS.
- Simplified build infrastructure using the .NET Core SDK.
- Use various new C# 7.2 language features to simplify the code.
- Uses
Version.TryParse()internally. - Added assets for working on the project in Visual Studio Code.
- Removed the following types:
ISqlLocalDbInstanceSqlLocalDbApi(static class)
- Configuration no longer via
System.Configurationand.configfiles. - Removed old "Blog" sample application.
- Removed Coverity scan integration.
- Depend on
Microsoft.Data.SqlClientinstead ofSystem.Data.SqlClient. - Add nullable reference type annotations.
- Change constants in the
SqlLocalDbErrorsclass to fields.
- Support deterministics and reproducible builds
- Publish symbol packages to NuGet.org.
- Use GitHub Actions for CI.
- Prepare for .NET 6.
- Add
net6.0Target Framework Moniker.
- Fix incorrect minimum dependency versions when targeting
net6.0.
- Add
net8.0Target Framework Moniker.
- Update Microsoft.Data.SqlClient dependency versions to
2.1.7fornetstandard2.0/net6.0and5.1.5fornet8.0to include fixes for CVE-2024-0056. - Use interop methods that are compatible with .NET native AoT.
- Update Microsoft.Data.SqlClient dependency to 6.0.2.
- Drop support for
netstandard2.0andnet6.0. - Add support for
net462. - Set
IsAotCompatible=truefornet8.0.