From 582d4b60fef9aca20d276e1e9eb10ca4d5acf2c3 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 27 Jun 2025 17:00:17 -0400 Subject: [PATCH] Delete unused method and linker suppression --- .../Server/AIFunctionMcpServerTool.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs b/src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs index 39dd19e3e..725aaf3ec 100644 --- a/src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs +++ b/src/ModelContextProtocol.Core/Server/AIFunctionMcpServerTool.cs @@ -70,14 +70,6 @@ internal sealed partial class AIFunctionMcpServerTool : McpServerTool options); } - // TODO: Fix the need for this suppression. - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2111:ReflectionToDynamicallyAccessedMembers", - Justification = "AIFunctionFactory ensures that the Type passed to AIFunctionFactoryOptions.CreateInstance has public constructors preserved")] - internal static Func GetCreateInstanceFunc() => - static ([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] type, args) => args.Services is { } services ? - ActivatorUtilities.CreateInstance(services, type) : - Activator.CreateInstance(type)!; - private static AIFunctionFactoryOptions CreateAIFunctionFactoryOptions( MethodInfo method, McpServerToolCreateOptions? options) => new()