diff --git a/src/StreamJsonRpc/MessagePackFormatter.cs b/src/StreamJsonRpc/MessagePackFormatter.cs
index 01d0fd10c..d2aa723da 100644
--- a/src/StreamJsonRpc/MessagePackFormatter.cs
+++ b/src/StreamJsonRpc/MessagePackFormatter.cs
@@ -1346,6 +1346,7 @@ public void Serialize(ref MessagePackWriter writer, T? value, MessagePackSeriali
/// 3. Declare a constructor with a signature of (, ).
///
[RequiresDynamicCode(RuntimeReasons.CloseGenerics)]
+ [RequiresUnreferencedCode(RuntimeReasons.LoadType)]
private class MessagePackExceptionResolver : IFormatterResolver
{
///
diff --git a/src/StreamJsonRpc/Reflection/MessageFormatterEnumerableTracker.cs b/src/StreamJsonRpc/Reflection/MessageFormatterEnumerableTracker.cs
index c365cbd2d..24097f4ab 100644
--- a/src/StreamJsonRpc/Reflection/MessageFormatterEnumerableTracker.cs
+++ b/src/StreamJsonRpc/Reflection/MessageFormatterEnumerableTracker.cs
@@ -100,9 +100,6 @@ private interface IGeneratingEnumeratorTracker : System.IAsyncDisposable
///
/// The type which may implement .
/// true if given implements ; otherwise, false.
- ///
- /// We use as a generic type argument in this because what we use doesn't matter, but we must use *something*.
- ///
public static bool CanSerialize(Type objectType) => TrackerHelpers.FindIAsyncEnumerableInterfaceImplementedBy(objectType) is not null;
///
@@ -110,9 +107,6 @@ private interface IGeneratingEnumeratorTracker : System.IAsyncDisposable
///
/// The type which may be .
/// true if given is ; otherwise, false.
- ///
- /// We use as a generic type argument in this because what we use doesn't matter, but we must use *something*.
- ///
public static bool CanDeserialize(Type objectType) => TrackerHelpers.IsIAsyncEnumerable(objectType);
///
diff --git a/src/StreamJsonRpc/Reflection/MessageFormatterProgressTracker.cs b/src/StreamJsonRpc/Reflection/MessageFormatterProgressTracker.cs
index bd8d95520..bd7c48ccf 100644
--- a/src/StreamJsonRpc/Reflection/MessageFormatterProgressTracker.cs
+++ b/src/StreamJsonRpc/Reflection/MessageFormatterProgressTracker.cs
@@ -70,8 +70,7 @@ public MessageFormatterProgressTracker(JsonRpc jsonRpc, IJsonRpcFormatterState f
///
/// The type which may implement .
/// The from given object, or if no such interface was found in the given .
- public static Type? FindIProgressOfT(Type objectType)
- => TrackerHelpers.FindIProgressInterfaceImplementedBy(objectType);
+ public static Type? FindIProgressOfT(Type objectType) => TrackerHelpers.FindIProgressInterfaceImplementedBy(objectType);
///
/// Checks if a given implements .
diff --git a/src/StreamJsonRpc/Reflection/RpcMarshalableOptionalInterfaceAttribute.cs b/src/StreamJsonRpc/Reflection/RpcMarshalableOptionalInterfaceAttribute.cs
index 90cab6251..95e1703db 100644
--- a/src/StreamJsonRpc/Reflection/RpcMarshalableOptionalInterfaceAttribute.cs
+++ b/src/StreamJsonRpc/Reflection/RpcMarshalableOptionalInterfaceAttribute.cs
@@ -37,7 +37,7 @@ public class RpcMarshalableOptionalInterfaceAttribute : Attribute
/// updating RPC interfaces.
/// The of the known optional interface that the marshalable
/// object may implement.
- public RpcMarshalableOptionalInterfaceAttribute(int optionalInterfaceCode, Type optionalInterface)
+ public RpcMarshalableOptionalInterfaceAttribute(int optionalInterfaceCode, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type optionalInterface)
{
this.OptionalInterfaceCode = optionalInterfaceCode;
this.OptionalInterface = optionalInterface;