Skip to content

Commit 4a70156

Browse files
Refactor McpSession class for improved readability and maintainability
1 parent 1dd9067 commit 4a70156

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ModelContextProtocol/Shared/McpSession.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,11 @@ public async Task<JsonRpcResponse> SendRequestAsync(JsonRpcRequest request, Canc
397397
finally
398398
{
399399
_pendingRequests.TryRemove(request.Id, out _);
400+
#if NETSTANDARD2_0
401+
registration.Dispose();
402+
#else
400403
await registration.DisposeAsync().ConfigureAwait(false);
404+
#endif
401405
FinalizeDiagnostics(activity, startingTimestamp, durationMetric, ref tags);
402406
}
403407
}

0 commit comments

Comments
 (0)