Resolving System.Data.SQLite.SEE.License FileNotFoundException in Version 1.0.115.5
Understanding the FileNotFoundException for System.Data.SQLite.SEE.License in Updated NuGet Packages
The System.Data.SQLite.Core and Stub.System.Data.SQLite.Core.NetFramework NuGet packages are widely used to integrate SQLite functionality into .NET applications. After updating these packages from version 1.0.114 to 1.0.115.5, developers may encounter a runtime exception:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite.SEE.License, Version=1.0.115.5, Culture=neutral, PublicKeyToken=************'
This error occurs during the first use of the SQLite DLL and indicates that the SEE.License assembly is missing. While the error might appear transient in test environments (e.g., a "scratch project"), it can persist in production deployments, causing instability. The SEE.License component is tied to SQLite’s proprietary encryption extension (SEE), which requires a valid license. The abrupt appearance of this error after a minor version update suggests changes in dependency resolution or licensing enforcement mechanisms within the NuGet packages.
To fully resolve this, it is critical to understand the relationship between the System.Data.SQLite.Core package, its .NET Framework stub counterpart, and the SEE.License assembly. The System.Data.SQLite.SEE.License DLL is a licensing artifact for SQLite’s encrypted database features. Applications that do not use encryption may still trigger this error if the updated package erroneously references the SEE component. Conversely, applications leveraging encryption must ensure the SEE license is properly configured.
The error manifests as a first-chance exception in debug environments, which may be swallowed by the runtime or application code, creating a false sense of security. In production, unhandled exceptions of this type can lead to crashes. The discrepancy between test and production behavior often stems from differences in exception handling strategies or build configurations.
Root Causes of the Missing System.Data.SQLite.SEE.License Assembly
1. Implicit Dependency on SQLite Encryption Extension (SEE)
The System.Data.SQLite.Core 1.0.115.5 package may have introduced an implicit dependency on the SEE.License assembly, even for applications not explicitly using encryption. This could result from a build misconfiguration where the SEE components are included by default in the updated package but require a valid license file to operate. If the application does not have a SEE license, the runtime cannot locate the SEE.License assembly, triggering the exception.
2. NuGet Package Version Mismatch or Incomplete Installation
The Stub.System.Data.SQLite.Core.NetFramework package acts as a shim to resolve platform-specific dependencies. If the stub package (1.0.115.5) is updated without a corresponding update to the SEE license components, or if the NuGet package restore process fails to include the SEE.License assembly, the runtime binding fails. This is exacerbated when projects reference multiple packages with conflicting version requirements, leading to incomplete or mismatched dependencies.
3. Licensing Validation Changes in SQLite 1.0.115.5
The SQLite development team may have tightened licensing validation in version 1.0.115.5 to enforce compliance with SEE terms. Applications using the System.Data.SQLite.Core package without a valid SEE license would now fail at runtime due to stricter checks. This aligns with the SQLite team’s response directing users to the SEE forum for licensing inquiries, implying that the error is intentional for unlicensed usage.
4. Incorrect Assembly Binding or Publisher Policy
The .NET runtime uses assembly binding redirects to resolve version conflicts. If the SEE.License assembly is referenced with a specific version (1.0.115.5) but the application configuration lacks a binding redirect to a compatible version, the runtime cannot locate the assembly. This is common in applications upgraded from older versions without updating the app.config
or web.config
files.
Resolving the Missing SEE.License Error: Configuration, Licensing, and Workarounds
Step 1: Validate SQLite Encryption Extension (SEE) Licensing Status
If your application uses SQLite’s encryption features, ensure that you possess a valid SEE license. The SEE.License assembly is distributed separately to licensees and must be included in the build output. Contact the SQLite team via the SEE forum to confirm your license status and obtain the correct System.Data.SQLite.SEE.License DLL.
For applications not using encryption, downgrade to System.Data.SQLite.Core 1.0.114 and its corresponding stub package. This version does not enforce SEE licensing checks, eliminating the exception. Use the NuGet Package Manager Console to revert:
Uninstall-Package System.Data.SQLite.Core -Force
Install-Package System.Data.SQLite.Core -Version 1.0.114
Uninstall-Package Stub.System.Data.SQLite.Core.NetFramework -Force
Install-Package Stub.System.Data.SQLite.Core.NetFramework -Version 1.0.114
Step 2: Audit NuGet Package Dependencies and Sources
The System.Data.SQLite.SEE.License assembly is not available on public NuGet repositories. If your project references a private NuGet feed for SEE components, verify that the feed is correctly configured in Visual Studio:
- Navigate to Tools > NuGet Package Manager > Package Manager Settings.
- Under Package Sources, ensure the private feed URL (provided with your SEE license) is listed and enabled.
- Restore packages to download the SEE.License assembly.
If the assembly is still missing, manually reference it in your project:
- Right-click the project in Solution Explorer and select Add > Existing Item.
- Browse to the SEE.License.dll provided by SQLite and add it.
- Set the file’s Copy to Output Directory property to Copy always.
Step 3: Update Assembly Binding Redirects
Modify the application’s configuration file to include binding redirects for the SEE.License assembly. This ensures the runtime uses the correct version:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite.SEE.License" publicKeyToken="YOUR_PUBLIC_KEY_TOKEN" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.115.5" newVersion="1.0.115.5" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Replace YOUR_PUBLIC_KEY_TOKEN
with the token from the error message.
Step 4: Suppress the Exception with Runtime Version Unification
If the error persists and encryption is not required, force the runtime to ignore the missing assembly by adding the following to your AppDomain
initialization code:
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => {
if (args.Name.Contains("System.Data.SQLite.SEE.License")) {
return null; // Ignore the missing assembly
}
// Resolve other assemblies normally
return null;
};
Note: This workaround is not recommended for production applications, as it may destabilize SQLite functionality.
Step 5: Engage with SQLite Support for License Clarification
As indicated in the forum response, SQLite’s SEE licensing model requires direct engagement with their team. Submit a detailed query via the SEE forum, including:
- Your SEE license key
- The exact error message and stack trace
- The application’s target framework and deployment environment
The SQLite team can provide updated binaries or configuration guidance tailored to your license.
By methodically addressing licensing requirements, dependency management, and runtime configuration, developers can resolve the SEE.License FileNotFoundException and ensure stable operation of SQLite-integrated applications.