Skip to content

Make Microsoft.Data.Sqlite unloadable #27498

@GabrieleGervasiPEL

Description

@GabrieleGervasiPEL

Description:
Unable to unload AssemblyLoadContext after creating a Microsoft.Data.Sqlite.SqliteConnection

Reproduction Steps:

  1. Take the unloading solution from https://github.com/dotnet/samples/tree/main/core/tutorials/Unloading
  2. Upgrade the solution targeting Net6.0
  3. Add EnableDynamicLoading at true in Plugin.csproj
  4. Implement LoadUnmanagedDll to HostAssemblyLoadContext
  5. Add nuget reference to Microsoft.Data.Sqlite 6.0.2 in project Plugin
  6. In PluginClass constructor add: using var connection = new Microsoft.Data.Sqlite.SqliteConnection();
  7. All those steps are already implemented in zipped project

Unloading_MicrosoftDataSqlite.zip

Microsoft.Data.Sqlite version: 6.0.2
Target framework: Net 6.0
Operating system: Windows 10

Could be related with dotnet/runtime#65781

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions