-
Notifications
You must be signed in to change notification settings - Fork 39
Conversation
src/mcpdotnet/Configuration/McpServerBuilderExtensions.Tools.cs
Outdated
Show resolved
Hide resolved
src/Common/Polyfills/System/Diagnostics/CodeAnalysis/DynamicallyAccessedMemberTypes.cs
Outdated
Show resolved
Hide resolved
src/Common/Polyfills/System/Diagnostics/CodeAnalysis/UnconditionalSuppressMessageAttribute.cs
Outdated
Show resolved
Hide resolved
src/mcpdotnet/Configuration/McpServerBuilderExtensions.Tools.cs
Outdated
Show resolved
Hide resolved
AOT-related experience is a big gap of mine, sadly, so I don't have anything of value to add here, but following this with great interest. |
ca31f95
to
7811ab0
Compare
@stephentoub I've rebased my changes on top of yours. Should be ready to go in now. |
2a6b407
to
911dcc2
Compare
src/Common/Polyfills/System/Diagnostics/CodeAnalysis/DynamicallyAccessedMembersAttribute.cs
Outdated
Show resolved
Hide resolved
{ | ||
public static JsonSerializerOptions DefaultOptions { get; } = CreateDefaultOptions(); | ||
|
||
/// <summary> | ||
/// Creates default options to use for MCP-related serialization. | ||
/// </summary> | ||
/// <returns>The configured options.</returns> | ||
[UnconditionalSuppressMessage("AotAnalysis", "IL3050", Justification = "DefaultJsonTypeInfoResolver is only used when reflection-based serialization is enabled")] | ||
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026", Justification = "DefaultJsonTypeInfoResolver is only used when reflection-based serialization is enabled")] | ||
private static JsonSerializerOptions CreateDefaultOptions() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to create this as chained with AIJsonUtilities.DefaultOptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's something I considered but figured I should keep independent from a trimmability perspective. We can revisit if we think it's important. I'm gravitating towards a model where protocol DTOs hardcode the source generator and we only use JSO for tool calling.
@stephentoub Me pushing changes ended up dismissing your review, could you resubmit one please? |
Turns on the AOT analyzer for the main projects.
Fix #59.