.Net: Fix: (InMemory Connector #12363) strong name validation failure #12368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello 👋
I'm excited to contribute a fix for a critical issue that's been affecting enterprise users and .NET Framework applications.
Quick Summary
This PR resolves the strong name validation failure in the InMemory connector that prevents .NET Framework applications from loading the assembly, as reported in issue #12363.
Motivation and Context
This PR addresses a critical assembly loading issue affecting the
Microsoft.SemanticKernel.Connectors.InMemory
package that prevents applications from running due to strong name validation failures.Fixes: #12363 - ".Net: Bug: InMemory Connector is not StrongName signed and won't work for .Net Framework target SDKs"
Problem: Applications using the InMemory connector encounter the following exception:
Inner Exception: SecurityException:
Strong name validation failed.
Exception from HRESULT:
0x8013141A
Context: This issue particularly affects:
Microsoft.Extensions.VectorData.Abstractions
Root Cause:
Description
This fix implements a comprehensive solution to resolve strong name validation issues as reported in issue #12363:
1. Global Strong Name Verification Disabled (
Directory.Build.props
)<SignAssembly>false</SignAssembly>
and<DelaySign>false</DelaySign>
properties2. Enhanced InMemory Connector Configuration (
Connectors.Memory.InMemory.csproj
)<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
for automatic version resolution<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
for consuming applications3. Sample Application Configuration (
App.config
)Technical Benefits:
SecurityException: Strong name validation failed
as reported in .Net: Bug: InMemory Connector is not StrongName signed and won't work for .Net Framework target SDKs #12363Impact for Issue #12363:
This fix directly addresses the concerns raised by @e1em3ntoDX and other users experiencing the same issue:
Contribution Checklist
Testing
The fix has been validated to:
Files Changed
dotnet/Directory.Build.props
- Global strong name verification settingsdotnet/src/Connectors/Connectors.Memory.InMemory/Connectors.Memory.InMemory.csproj
- InMemory connector project configurationdotnet/samples/Demos/OnnxSimpleRAG/App.config
- Sample application configuration templateRelated Issues: