Add support for data to McpProtocolException (#1028)

This commit is contained in:
Copilot 2025-12-03 15:37:54 -08:00 • committed by GitHub
commit db0f4d13b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,4 +6,13 @@ internal static class PlatformDetection
{
public static bool IsMonoRuntime { get; } = Type.GetType("Mono.Runtime") is not null;
public static bool IsWindows { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
// On .NET Framework, Exception.Data requires values to be serializable with [Serializable].
// JsonElement is not marked as serializable, so certain features are not available on that platform.
public static bool IsNetFramework { get; } =
#if NET
false;
#else
true;
#endif
}