Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Initial pass for native aot annotations for inmemory connector. #11100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

azchohfi
Copy link

Motivation and Context

Microsoft.SemanticKernel.Connectors.InMemory warns if using NativeAOT.
This PR contributes to #10256, and helps make SK NativeAOT compatible.

Description

In the InMemory project, I've turned PublishAot to true, then built the project.
This shows a number of warnings. This PR solves all of those warning but the JsonSerializer ones, that are part of a longer discussion in the linked issue. The solution is to simply annotate the calling methods/types/generic definitions with the suggested attributes, which now bubble up to any possible callers, allowing the linker to not remove some specific methods/ctors.

Contribution Checklist

@azchohfi azchohfi requested a review from a team as a code owner March 21, 2025 00:11
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel memory labels Mar 21, 2025
@github-actions github-actions bot changed the title Initial pass for native aot annotations for inmemory connector. .Net: Initial pass for native aot annotations for inmemory connector. Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel memory .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants