You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.Net: System.TypeLoadException Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql' #3121
The application throws an unhandled exception related to the loading of System.Data.Common.DbDataSource from assembly 'Npgsql'. This happens when the application attempts to dispose of the PostgresMemoryStore.
To Reproduce
Inject an instance of IMemory store :
builder.Services.AddScoped<IMemoryStore>(provider =>
{
var dataSourceBuilder = new NpgsqlDataSourceBuilder(builder.Configuration.GetConnectionString("PostgresConnectionString"));
dataSourceBuilder.UseVector();
return new PostgresMemoryStore(dataSourceBuilder.Build(), 1536);
});
Expected behavior
The application should smoothly dispose of the PostgresMemoryStore without any errors.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMU9S3SSK6LB", Request id "0HMU9S3SSK6LB:00000001": An unhandled exception was thrown by the application.
System.TypeLoadException: Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql, Version=7.0.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'.
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresMemoryStore.Dispose(Boolean disposing)
at Microsoft.SemanticKernel.Connectors.Memory.Postgres.PostgresMemoryStore.Dispose()
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.DisposeAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Http.Features.RequestServicesFeature.<DisposeAsync>g__Awaited|9_0(RequestServicesFeature servicesFeature, ValueTask vt)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.<FireOnCompleted>g__ProcessEvents|242_0(HttpProtocol protocol, Stack`1 events)
info: Microsoft.IdentityModel.LoggingExtensions.IdentityLoggerAdapter[0]
changed the title [-]System.TypeLoadException Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql'[/-][+].Net: System.TypeLoadException Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql'[/+]on Oct 10, 2023
Activity
[-]System.TypeLoadException Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql'[/-][+].Net: System.TypeLoadException Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql'[/+].Net: Fix postgres memory store dispose (#3177)