Repository navigation
Conversation
…ectorData.Abstractions
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1670856&view=codecoverage-tab |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the IsExternalInit compatibility fix.
No open issues 🎉
What changed in this PR
This PR addresses MissingMethodException when consumers compiled against the .NET Standard build of Microsoft.Extensions.VectorData.Abstractions call init setters using the .NET build at runtime.
Changes:
- Forward
IsExternalInitto the runtime type in .NET builds. - Add a .NET-only test verifying that the assembly exposes the forward.
| File | Description |
|---|---|
| test/Libraries/Microsoft.Extensions.VectorData.Abstractions.Tests/TypeForwardingTests.cs | Verifies that IsExternalInit is forwarded to the runtime type. |
| src/Libraries/Microsoft.Extensions.VectorData.Abstractions/TypeForwards.cs | Adds the conditional type forward and explains its compatibility purpose. |
Review effort: Balanced
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1671827&view=codecoverage-tab |
A library compiled for
netstandard2.0that sets aninitproperty of this package, likeVectorStoreMetadata.VectorStoreName, fails on .NET 8 and .NET 9 withMissingMethodException. In thenetstandard2.0build the setter carries theIsExternalInitof this assembly; the application gets thenet8.0build, where it carries the one of the runtime.This comes from CommunityToolkit/AI#87, which removes
net8.0from the providers.Changes
TypeForwardedToforIsExternalInitin the .NET builds.Tests
chromadb/chroma:1.5.9and Milvus without a server. Both failed when the store was created. With the forward andMicrosoft.Bcl.AsyncInterfacesin the provider, Milvus created its store and collection, and Chroma, which also needs the same forward inChromaDotNet.Client, wrote, read, filtered and searched.Microsoft Reviewers: Open in CodeFlow
Not in this PR
Microsoft.Extensions.AI.AbstractionsandMicrosoft.Extensions.AIalso haveinitsetters and both .NET Standard and .NET builds. I did not test them.