How to Get the PublicKeyToken for SQLite e_sqlite3.dll in .NET
Quick Answer The SQLite native library e_sqlite3.dll does not have a .NET PublicKeyToken because it is a native Windows DLL, not a managed .NET assembly. Whe...
Quick Answer
The SQLite native library e_sqlite3.dll does not have a .NET PublicKeyToken because it is a native Windows DLL, not a managed .NET assembly.
When you attempt to retrieve its PublicKeyToken using the Microsoft Strong Name Tool (sn.exe), the following error is expected:
e_sqlite3.dll does not represent a strongly named assembly
This message does not necessarily indicate a damaged DLL, an incorrect NuGet installation or a problem with SQLite. The Strong Name Tool is simply being used on a file that does not support .NET strong naming.
If you require a PublicKeyToken for a .NET assembly reference, assembly binding configuration or dependency identification, you must inspect the managed SQLite assembly used by your application instead of the native e_sqlite3.dll file.
Understanding the SQLite NuGet Package Error
Developers using the SQLite NuGet package, including version 3.54.1, may encounter this issue when inspecting the following native runtime file:
.\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll
Running the following command from a Visual Studio Developer Command Prompt attempts to retrieve the assembly's PublicKeyToken:
sn.exe -T ".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll"
However, the tool reports:
runtimes\win-x64\native\e_sqlite3.dll does not represent a strongly named assembly
The reason is that the file contains native executable code rather than the managed assembly manifest required by the Strong Name Tool.
The win-x64 directory identifies the intended Windows x64 runtime platform, while the native directory identifies the file as a native runtime asset.
The same limitation applies to other native SQLite builds, regardless of their processor architecture or SQLite version.
What Is a PublicKeyToken in .NET?
A PublicKeyToken is a compact representation of the public key associated with a strong-named .NET assembly. It helps identify an assembly when it is referenced by another managed assembly.
A typical PublicKeyToken consists of eight bytes, represented as 16 hexadecimal characters.
A managed assembly's identity can include the following information:
- Assembly name: The logical name of the assembly.
- Version: The assembly's version number.
- Culture: The language or culture associated with the assembly.
- Public key or PublicKeyToken: Information associated with the assembly's strong-name identity.
The following is an illustrative example of an assembly identity. The token shown is for demonstration purposes only:
ExampleLibrary,
Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=0123456789abcdef
PublicKeyToken values are derived from public keys. They are not calculated from the DLL's entire file contents and should not be confused with SHA-256 file hashes or digital certificate thumbprints.
Different assemblies signed using the same strong-name identity key can have the same PublicKeyToken.
What Is e_sqlite3.dll?
The e_sqlite3.dll file is a native implementation of the SQLite database engine used by certain SQLite libraries and NuGet packages.
SQLite is primarily implemented in the C programming language. The native library contains the database engine responsible for operations such as:
- Opening and closing SQLite databases.
- Executing SQL statements.
- Processing database queries.
- Managing transactions.
- Reading and writing database files.
- Managing database indexes and storage.
In a typical .NET application using Microsoft.Data.Sqlite, a managed library communicates with the native SQLite engine through an interoperability layer.
The relationship can be represented as follows:
.NET Application
|
v
Microsoft.Data.Sqlite.dll
|
v
SQLitePCLRaw interoperability layer
|
v
e_sqlite3.dll (Native SQLite Engine)
|
v
SQLite Database File
The exact dependency arrangement varies according to the SQLite provider and NuGet packages installed in the project.
Although both managed assemblies and native Windows libraries can use the .dll extension, they are not interchangeable.
Native DLL vs Managed .NET Assembly
| Feature | Native DLL | Managed .NET Assembly |
|---|---|---|
| Example | e_sqlite3.dll |
Microsoft.Data.Sqlite.dll |
| Typical programming language | C or C++ | C#, VB.NET or F# |
| Execution environment | Operating system and native processor instructions | .NET runtime |
| .NET assembly manifest | Not present in a purely native DLL | Present |
| .NET strong-name support | No | Yes |
| PublicKeyToken | Not applicable | Available when a strong-name public key is present |
| Authenticode signing | Supported | Supported |
| Compatible with sn.exe | No | Yes, for applicable strong-name operations |
| .NET assembly binding redirects | Not applicable | Applicable in relevant .NET Framework scenarios |
This comparison concerns purely native libraries and ordinary managed assemblies. Mixed-mode assemblies may contain both native and managed components.
Why sn.exe Cannot Retrieve the PublicKeyToken
The Microsoft Strong Name Tool is designed to perform strong-name operations on .NET assemblies and associated cryptographic key files.
Its assembly-related operations depend on metadata contained in a valid .NET assembly manifest. A purely native library such as e_sqlite3.dll does not contain the required managed assembly identity.
The following commonly used Strong Name Tool parameters illustrate the distinction:
| Parameter | Purpose |
|---|---|
-T |
Displays the PublicKeyToken of a managed assembly. |
-Tp |
Displays the assembly's public key and PublicKeyToken. |
-v |
Performs strong-name verification on an assembly. |
-vf |
Forces strong-name verification. |
-t |
Calculates a token from a supported strong-name public key file. |
-tp |
Displays the public key and token from a supported public key file. |
Important: Strong Name Tool parameters are case-sensitive. The uppercase -T and lowercase -t options serve different purposes.
Changing these parameters, running the command as an administrator or reinstalling the Strong Name Tool will not create a PublicKeyToken for a purely native SQLite DLL.
How to Get the Correct SQLite PublicKeyToken
If your objective is to retrieve assembly identity information for a .NET application that uses SQLite, locate the managed assembly referenced by the application.
Depending on the installed provider and package versions, relevant managed assemblies may include:
Microsoft.Data.Sqlite.dllSQLitePCLRaw.core.dllSQLitePCLRaw.provider.e_sqlite3.dllSystem.Data.SQLite.dllSQLite-net.dll
These are examples from different SQLite integration libraries. They are not necessarily included in the SQLite 3.54.1 package itself, and their strong-name status should be checked individually.
Prerequisites
- A Windows computer with access to the .NET project or its compiled output.
- Read permissions for the relevant DLL files.
- Visual Studio with the Strong Name Tool available, or PowerShell.
- The managed SQLite assembly used by the application.
Administrator privileges are normally unnecessary for the following read-only diagnostic procedures.
Method 1: Get the PublicKeyToken Using sn.exe
- Open the Windows Start menu.
- Search for Developer Command Prompt for Visual Studio.
- Open the Developer Command Prompt.
- Navigate to the directory containing the managed SQLite assembly.
- Run the Strong Name Tool against the managed DLL.
For example, if your application uses Microsoft.Data.Sqlite:
sn.exe -T "Microsoft.Data.Sqlite.dll"
To retrieve both the public key and its token, use:
sn.exe -Tp "Microsoft.Data.Sqlite.dll"
If the assembly contains the required strong-name public key, the tool displays its PublicKeyToken.
If the assembly is not strong-named, there may be no PublicKeyToken to retrieve.
Always inspect the actual DLL used by your application instead of assuming that a token obtained from another library or package is correct.
Method 2: Get the PublicKeyToken Using PowerShell
PowerShell can read managed assembly identity information through the .NET reflection API.
Open PowerShell in the directory containing the managed assembly and execute:
$Path = ".\Microsoft.Data.Sqlite.dll"
$Assembly = [System.Reflection.AssemblyName]::GetAssemblyName(
(Resolve-Path -LiteralPath $Path).Path
)
$Token = $Assembly.GetPublicKeyToken()
if ($Token -and $Token.Length -gt 0) {
[System.BitConverter]::ToString($Token).Replace("-", "").ToLowerInvariant()
}
else {
Write-Output "No PublicKeyToken is present."
}
This script reads the managed assembly's identity and converts the PublicKeyToken bytes into a hexadecimal string.
To display the complete assembly identity, run:
$Assembly.FullName
The output can include the assembly name, version, culture and PublicKeyToken.
If the file is an unsigned managed assembly, its full identity may contain PublicKeyToken=null.
If you execute the same assembly-reading operation against a purely native DLL, .NET can report a BadImageFormatException because the file is not a valid managed assembly.
Method 3: Get the PublicKeyToken Using C#
Developers creating dependency inspection utilities, diagnostic applications or software inventory tools can retrieve assembly information programmatically.
The following C# console application accepts a DLL path, reads its managed assembly identity and displays its PublicKeyToken when available.
using System;
using System.IO;
using System.Reflection;
class Program
{
static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Please provide a DLL file path.");
return;
}
try
{
string filePath = Path.GetFullPath(args[0]);
AssemblyName assembly =
AssemblyName.GetAssemblyName(filePath);
byte[] token = assembly.GetPublicKeyToken();
string publicKeyToken =
token != null && token.Length > 0
? BitConverter.ToString(token)
.Replace("-", "")
.ToLowerInvariant()
: "null";
Console.WriteLine("Assembly: " + assembly.Name);
Console.WriteLine("Version: " + assembly.Version);
Console.WriteLine("PublicKeyToken: " + publicKeyToken);
}
catch (BadImageFormatException)
{
Console.WriteLine(
"The file is not a valid managed .NET assembly.");
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
The program reads assembly metadata without invoking the target library's application methods.
A native DLL, an invalid executable file or a damaged managed assembly can produce a BadImageFormatException. Therefore, this exception alone should not be treated as definitive proof that every affected file is native.
How to Find Managed Assemblies in a NuGet Package
NuGet packages can contain managed assemblies, native libraries, build configuration files, documentation and other supporting assets.
Common package directories include:
| Directory | Typical Purpose |
|---|---|
lib |
Framework-specific managed libraries. |
ref |
Reference assemblies used during compilation. |
runtimes |
Platform-specific runtime assets. |
runtimes\win-x64\native |
Native runtime files for Windows x64. |
runtimes\win-x86\native |
Native runtime files for Windows x86. |
runtimes\win-arm64\native |
Native runtime files for Windows ARM64, when supplied. |
build |
Package-specific MSBuild configuration. |
Not every NuGet package contains all these directories. Some packages supply only native binaries, while others provide managed libraries or multiple types of assets.
For projects using the older packages.config approach, packages are commonly stored in a solution-level directory:
.\packages\
For projects using PackageReference, the default global package directory on Windows is commonly:
%USERPROFILE%\.nuget\packages\
To identify the configured NuGet global package directory, execute:
dotnet nuget locals global-packages --list
Also inspect the application's compiled output directory to identify the managed assemblies actually deployed with the application.
How to Check Multiple DLL Files Using PowerShell
If a project contains several SQLite dependencies, checking each file with sn.exe can be inconvenient.
The following PowerShell script recursively inspects DLL files in the current directory and reports their managed assembly identity information when available.
Get-ChildItem -Path "." -Filter "*.dll" -Recurse -File |
ForEach-Object {
$File = $_
try {
$Assembly = [System.Reflection.AssemblyName]::GetAssemblyName(
$File.FullName
)
$Token = $Assembly.GetPublicKeyToken()
if ($Token -and $Token.Length -gt 0) {
$TokenText = [System.BitConverter]::ToString(
$Token
).Replace("-", "").ToLowerInvariant()
}
else {
$TokenText = "null"
}
[PSCustomObject]@{
File = $File.Name
Type = "Managed assembly"
Version = $Assembly.Version.ToString()
PublicKeyToken = $TokenText
Path = $File.FullName
}
}
catch [System.BadImageFormatException] {
[PSCustomObject]@{
File = $File.Name
Type = "Native or invalid managed assembly"
Version = "N/A"
PublicKeyToken = "Not applicable"
Path = $File.FullName
}
}
catch {
[PSCustomObject]@{
File = $File.Name
Type = "Unable to inspect"
Version = "Unknown"
PublicKeyToken = "Unknown"
Path = $File.FullName
}
}
} | Format-Table -AutoSize
Run this script from the project's output directory or the relevant NuGet package directory.
It is a read-only diagnostic operation and does not modify DLL files, NuGet packages, registry settings or SQLite databases.
The script distinguishes readable managed assembly metadata from files that cannot be interpreted as managed assemblies. Additional diagnostic tools may be necessary to distinguish native DLLs from corrupted or otherwise invalid files.
How to Confirm That e_sqlite3.dll Is a Native DLL
Visual Studio includes the Microsoft DUMPBIN utility, which can inspect Windows Portable Executable files.
Open a Visual Studio Developer Command Prompt and run:
dumpbin /headers ".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll"
The command displays information about the DLL's executable headers, including its target processor architecture and data directories.
For a typical purely native Windows DLL:
- The executable contains native processor instructions.
- The CLR Runtime Header data-directory entry is absent or zero.
- A managed .NET assembly manifest is not available.
You can also inspect the DLL's exported functions using:
dumpbin /exports ".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll"
Depending on the SQLite build, the exported functions may include:
sqlite3_opensqlite3_closesqlite3_prepare_v2sqlite3_stepsqlite3_finalizesqlite3_libversion
These functions are part of the native SQLite programming interface.
The exact exported functions and binary metadata depend on how the library was compiled. The commands should be run against your installed copy to confirm its actual contents.
Alternative Ways to Identify or Verify e_sqlite3.dll
Sometimes a developer requests a PublicKeyToken because they need to identify a DLL, verify its integrity, record its version or determine its publisher.
For a native library, other methods are more appropriate.
Option 1: Calculate the SHA-256 File Hash
A cryptographic file hash provides a fingerprint of the file's contents.
To calculate the SHA-256 hash using PowerShell, execute:
Get-FileHash -Algorithm SHA256 -LiteralPath `
".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll"
Alternatively, run the following command from Command Prompt:
certutil -hashfile ".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll" SHA256
A SHA-256 hash is useful for:
- Comparing copies of the same DLL.
- Software inventory and asset identification.
- Detecting changes to binary files.
- Comparing a file against a trusted reference hash.
- Recording deployed dependency versions alongside other metadata.
A calculated hash does not independently establish that a file is genuine or safe. Authenticity checks require comparison with a trusted reference or another reliable verification mechanism.
Option 2: Check the Authenticode Digital Signature
Native Windows DLLs can support Authenticode digital signatures, even though they do not support .NET strong naming.
To determine whether the SQLite DLL has an Authenticode signature, execute:
Get-AuthenticodeSignature -LiteralPath `
".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll" |
Format-List Status, StatusMessage, SignerCertificate
Possible signature status values include:
| Status | Meaning |
|---|---|
Valid |
The signature passes the applicable verification checks. |
NotSigned |
A recognized digital signature was not found. |
HashMismatch |
The file contents do not match the signed hash. |
NotTrusted |
The signature or its certificate is not trusted under the applicable verification rules. |
Other status values may also occur depending on the file and verification environment.
Do not assume that every distributed SQLite DLL is Authenticode-signed. Its signature status must be checked directly.
Option 3: Retrieve the Signing Certificate Thumbprint
If a signing certificate is available, PowerShell can display its subject, issuer and thumbprint.
$Signature = Get-AuthenticodeSignature -LiteralPath `
".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll"
if ($Signature.SignerCertificate) {
$Signature.SignerCertificate |
Format-List Subject, Issuer, Thumbprint, NotBefore, NotAfter
}
else {
Write-Output "No signing certificate is available."
}
A certificate thumbprint identifies the certificate. It is not the DLL's .NET PublicKeyToken and must not be used as a substitute in assembly binding configuration.
The availability of a signing certificate also does not automatically establish that the signature is valid. Review the signature status separately.
Option 4: Retrieve DLL Version Information
Some native Windows DLLs include version resources containing product and file information.
To inspect these properties, run:
(Get-Item -LiteralPath `
".\packages\SQLite.3.54.1\runtimes\win-x64\native\e_sqlite3.dll").VersionInfo |
Format-List FileVersion, ProductVersion, ProductName,
CompanyName, OriginalFilename, FileDescription
Some properties may be empty if the DLL was compiled without the corresponding version resources.
File version information is also not guaranteed to match the NuGet package version or the managed assembly version.
Option 5: Verify the SQLite Engine Version
If the application already provides a working connection to a SQLite database, the actual SQLite engine version can be queried using SQL:
SELECT sqlite_version();
This returns the version of the SQLite engine handling the current connection.
This method is particularly useful when an application might load a different native SQLite library from the one expected during deployment.
PublicKeyToken vs SHA-256 Hash vs Certificate Thumbprint
| Identifier | Primary Purpose | Applicable to e_sqlite3.dll? |
|---|---|---|
| .NET PublicKeyToken | Managed assembly identity | No |
| SHA-256 file hash | Binary fingerprint and integrity comparison | Yes |
| Authenticode signature | Publisher and signed-file verification | Yes, when signed |
| Certificate thumbprint | Identification of a digital certificate | Yes, when a relevant certificate is available |
| File version | Version identification through Windows file metadata | Yes, when version resources are present |
| SQLite engine version | Identification of the running SQLite engine version | Yes, through the SQLite API or SQL query |
These identifiers serve different purposes. Select the appropriate method according to whether you need assembly identity, binary integrity, publisher information or version tracking.
Can e_sqlite3.dll Be Added to an Assembly Binding Redirect?
No. A purely native SQLite DLL is not directly managed through .NET Framework assembly binding redirects.
Binding redirects are used to control which versions of managed assemblies are selected in applicable .NET Framework applications.
The configuration typically identifies managed assemblies by their assembly names, versions, cultures and PublicKeyToken values.
Native DLL loading follows different rules involving the .NET interoperability layer, operating system loader, deployment directories and processor architecture.
If your application cannot load e_sqlite3.dll, adding a PublicKeyToken or a binding redirect for the native DLL will not resolve the issue.
Modern .NET applications also use different assembly and dependency resolution mechanisms from traditional .NET Framework applications.
Troubleshooting SQLite Native DLL Loading Errors
The absence of a PublicKeyToken is not itself a SQLite runtime error. However, developers investigating this issue may also encounter native library loading problems.
| Error or Symptom | Possible Cause | Recommended Diagnostic Action |
|---|---|---|
| Does not represent a strongly named assembly | The file is native or lacks the required strong-name information. | Confirm the file type and inspect the managed assembly instead. |
DllNotFoundException |
The native library or one of its dependencies cannot be located or loaded. | Inspect deployed runtime files and native dependency resolution. |
BadImageFormatException |
An incompatible binary format, architecture mismatch or invalid managed assembly. | Check the intended file type, processor architecture and file integrity. |
EntryPointNotFoundException |
A required exported function cannot be located. | Check the native DLL's exported functions and provider compatibility. |
FileLoadException |
A managed assembly was located but could not be loaded successfully. | Review the complete exception, managed dependencies and runtime configuration. |
Step 1: Verify the Application Architecture
Confirm that the native SQLite DLL matches the architecture of the running application process.
| Application Process | Required Native DLL Architecture |
|---|---|
| Windows x86 | x86 |
| Windows x64 | x64 |
| Windows ARM64 | ARM64 |
A 64-bit Windows operating system can also run 32-bit applications. Therefore, the operating system architecture alone is insufficient to determine which native SQLite DLL is required.
The following C# statements can help identify the architecture of the running .NET application on supported target frameworks:
Console.WriteLine(
System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture
);
Console.WriteLine(
Environment.Is64BitProcess
);
Step 2: Verify That the Native DLL Is Deployed
Check the application's build or publish output and confirm that the correct SQLite runtime assets are available.
The expected deployment location depends on the project type, .NET runtime, NuGet configuration and publishing method.
Avoid assuming that every native DLL must be copied directly into the executable directory. Some application configurations resolve native libraries from runtime-specific subdirectories.
Step 3: Inspect Native Dependencies
Use DUMPBIN to inspect dependencies declared by the native library:
dumpbin /dependents "e_sqlite3.dll"
Review the results for missing or incompatible dependencies.
Do not assume that a particular Microsoft Visual C++ Redistributable is required without first confirming the dependencies of the relevant SQLite build.
Step 4: Verify NuGet Dependencies and Restore Packages
Review the installed NuGet packages and ensure that the managed SQLite provider and native SQLite library are compatible.
For compatible SDK-style .NET projects, package restoration can be performed using:
dotnet restore
For older projects using packages.config, use the applicable Visual Studio or NuGet restore mechanism.
Package restoration may download dependencies and update generated project assets. It is not a method for creating a PublicKeyToken for a native DLL.
Step 5: Verify SQLite Functionality
After correcting any native DLL deployment or dependency issue, test the application using a non-production database or an appropriate test environment.
Where the application supports executing SQL queries, run:
SELECT sqlite_version();
A successful result confirms that the application has established a working connection to a SQLite engine and can execute this query.
It does not independently verify that every application feature or database operation is functioning correctly.
Can You Strong-Name a Native SQLite DLL?
No. The .NET strong-name mechanism cannot be applied directly to a purely native SQLite DLL using sn.exe.
Generating a strong-name key pair or attempting to re-sign the native library will not convert it into a managed .NET assembly.
If a software project requires a strong-named managed component, possible approaches include:
- Using a compatible managed SQLite provider that already has a strong-name identity.
- Building and strong-naming a managed wrapper that communicates with the native SQLite library.
- Using Authenticode signing when native binary publisher verification is required.
A strong-named managed wrapper remains separate from the native SQLite binary. Signing the wrapper does not assign a PublicKeyToken to e_sqlite3.dll.
Does Signing the NuGet Package Give Its DLLs a PublicKeyToken?
No. NuGet package signing and managed assembly strong naming are separate mechanisms.
A NuGet package can contain a package-level digital signature while also containing native binaries and unsigned managed assemblies.
The presence of a signed NuGet package does not mean that:
- Every DLL has a .NET PublicKeyToken.
- Every DLL is individually Authenticode-signed.
- Every managed assembly is strong-named.
- Every binary uses the same signing identity.
Package-level signatures, individual file signatures and managed assembly identities must be evaluated independently.
Security Considerations
A PublicKeyToken should not be treated as proof that a DLL is safe, authentic or free from malicious modifications.
Microsoft advises against relying on strong names as a security trust mechanism. Their primary purpose is assembly identification.
When validating SQLite libraries and other application dependencies:
- Obtain NuGet packages from trusted package sources.
- Review package publisher and dependency information.
- Use appropriate package signature verification mechanisms.
- Compare file hashes against trusted reference values when available.
- Verify Authenticode signatures when applicable.
- Maintain supported and appropriately updated dependencies.
- Avoid replacing native DLLs with binaries obtained from unknown download websites.
- Do not disable strong-name verification merely to bypass an assembly error.
- Test dependency changes before deploying them to production systems.
These practices address software integrity and dependency management more effectively than attempting to assign a PublicKeyToken to a native library.
Frequently Asked Questions
What is the PublicKeyToken of SQLite 3.54.1 e_sqlite3.dll?
There is no applicable .NET PublicKeyToken for the native e_sqlite3.dll library distributed under the native runtime directory. PublicKeyToken information must be obtained from a relevant managed assembly instead.
Can I use PublicKeyToken=null for e_sqlite3.dll?
No. Although an unsigned managed assembly may have an identity containing PublicKeyToken=null, a purely native DLL does not have a managed assembly identity in the first place. The correct classification is that PublicKeyToken is not applicable.
Does the sn.exe error mean the SQLite DLL is corrupted?
Not necessarily. For a purely native SQLite DLL, the error is expected. If corruption is suspected for another reason, compare the file against a trusted package copy or use suitable file-integrity checks.
Will running sn.exe as an administrator resolve the problem?
No. Administrator privileges cannot add managed assembly metadata or strong-name information to a native DLL.
Can I use Pktextract.exe to retrieve the token?
No. A certificate-oriented token extraction utility does not convert a native executable library into a strong-named .NET assembly. Extracting information from a certificate cannot create a managed assembly identity for e_sqlite3.dll.
Does changing the DLL from x64 to x86 provide a PublicKeyToken?
No. Processor architecture does not determine whether a DLL supports .NET strong naming. A purely native SQLite DLL lacks a .NET PublicKeyToken regardless of whether it targets x86, x64 or ARM64.
Does every managed SQLite assembly have a PublicKeyToken?
No. Managed assemblies can be distributed without strong naming. Inspect the specific managed DLL used by your application to determine whether a token is available.
Is the PublicKeyToken the same for every version of a managed assembly?
Not necessarily. Assemblies associated with the same strong-name identity key ordinarily have the same PublicKeyToken, even when their versions differ. Changing the identity key can change the token.
Can I use a SHA-256 hash instead of a PublicKeyToken in an assembly binding redirect?
No. A file hash is not a managed assembly PublicKeyToken. It cannot be substituted for the token in assembly binding configuration.
Do I need to install another SQLite NuGet package to fix this error?
Not solely because of this error. If your application is working correctly, no SQLite package replacement is required. Consider a different managed provider only if your project has a specific compatibility or strong-name requirement that the existing provider does not satisfy.
Key Takeaways
e_sqlite3.dllis a native SQLite library, not a managed .NET assembly.- A purely native DLL does not have a .NET PublicKeyToken.
- The Strong Name Tool error is expected when used against this native library.
- Use
sn.exe -T, PowerShell or the .NET reflection API to retrieve the token of an applicable managed assembly. - Use SHA-256 hashes for binary fingerprinting and integrity comparisons.
- Use Authenticode verification for publisher and signed-file verification when signatures are available.
- Native SQLite loading problems must be investigated separately through deployment, architecture and dependency diagnostics.
- Do not modify or replace a functioning SQLite installation solely because its native DLL has no PublicKeyToken.
Official References and Further Reading
- Microsoft Learn - Sn.exe (Strong Name Tool)
- Microsoft Learn - AssemblyName.GetAssemblyName Method
- Microsoft Learn - Custom SQLite Versions and Native Providers
- Microsoft Learn - Microsoft.Data.Sqlite Interoperability
- NuGet Gallery - SQLite 3.54.1
Version and verification note: This article addresses the reported native runtime DLL in SQLite NuGet package version 3.54.1 and the general distinction between native libraries and managed .NET assemblies. The package listing and relevant Microsoft documentation were reviewed, but the individual package binaries were not independently downloaded or tested. Exact file hashes, Authenticode signatures, exported functions and managed assembly PublicKeyToken values should therefore be verified against the files installed in your own environment.
Was this guide useful?
Your answer helps us keep BISONKB accurate and practical.