From cd289b2b09b0b5c67ae9aaffb11e24800e54b3dc Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Fri, 6 Mar 2026 13:42:55 -0800 Subject: [PATCH 1/3] fix: Chat runtime failure Fix failure: Method 'ValidateKeyProperty' in type 'Microsoft.SemanticKernel.Connectors.PgVector.PostgresModelBuilder' from assembly 'Microsoft.SemanticKernel.Connectors.PgVector, Version=1.70.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3' does not have an implementation. --- Directory.Packages.props | 7 +++-- .../PgVectorConnectorTests.cs | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 0012ca46..f9fcf955 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -12,6 +12,9 @@ https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json; + + 1.72.0 + @@ -36,8 +39,8 @@ - - + + diff --git a/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs b/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs new file mode 100644 index 00000000..ad987a18 --- /dev/null +++ b/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs @@ -0,0 +1,28 @@ +using EssentialCSharp.Chat.Common.Models; +using Microsoft.SemanticKernel.Connectors.PgVector; + +#pragma warning disable SKEXP0010 // PgVector APIs are experimental + +namespace EssentialCSharp.Chat.Tests; + +public class PgVectorConnectorTests +{ + /// + /// Verifies that PostgresVectorStore.GetCollection does not throw a TypeLoadException, + /// which would indicate a version mismatch between Microsoft.SemanticKernel core and + /// Microsoft.SemanticKernel.Connectors.PgVector (e.g., missing vtable slots on + /// internal types like PostgresModelBuilder). + /// + [Test] + public async Task GetCollection_WithBookContentChunk_DoesNotThrowTypeLoadException() + { + // Arrange — no real DB connection is needed; connections are only opened for actual queries + var store = new PostgresVectorStore("Host=localhost;Database=test;Username=test;Password=test"); + + // Act — this triggers loading internal PostgresModelBuilder via PostgresCollection ctor + var collection = store.GetCollection("test-collection"); + + // Assert + await Assert.That(collection).IsNotNull(); + } +} From d474c6518a1ad2cc8b6750dc8fceae33b99a3065 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Fri, 6 Mar 2026 13:46:20 -0800 Subject: [PATCH 2/3] chore: Ignore TestResults/ directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b5450468..7a8c84ce 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ EssentialCSharpManuscript.[0-9] .vs/ obj bin +TestResults/ ~$*.do[ct]x ~*.tmp ~$*.dotm From 9debcd52faaf3f554b57c31cf486e855293aff46 Mon Sep 17 00:00:00 2001 From: Benjamin Michaelis Date: Fri, 6 Mar 2026 14:21:48 -0800 Subject: [PATCH 3/3] fix --- EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs b/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs index ad987a18..ed5c9fe9 100644 --- a/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs +++ b/EssentialCSharp.Chat.Tests/PgVectorConnectorTests.cs @@ -1,8 +1,6 @@ using EssentialCSharp.Chat.Common.Models; using Microsoft.SemanticKernel.Connectors.PgVector; -#pragma warning disable SKEXP0010 // PgVector APIs are experimental - namespace EssentialCSharp.Chat.Tests; public class PgVectorConnectorTests @@ -17,10 +15,12 @@ public class PgVectorConnectorTests public async Task GetCollection_WithBookContentChunk_DoesNotThrowTypeLoadException() { // Arrange — no real DB connection is needed; connections are only opened for actual queries - var store = new PostgresVectorStore("Host=localhost;Database=test;Username=test;Password=test"); +#pragma warning disable SKEXP0010 // PostgresVectorStore is experimental + using var store = new PostgresVectorStore("Host=localhost;Database=test;Username=test;Password=test"); // Act — this triggers loading internal PostgresModelBuilder via PostgresCollection ctor var collection = store.GetCollection("test-collection"); +#pragma warning restore SKEXP0010 // Assert await Assert.That(collection).IsNotNull();