Add support for data to McpProtocolException (#1028)
This commit is contained in:
parent
136755f2be
commit
db0f4d13b4
1 changed files with 311 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
Loading…
Reference in a new issue