Move options validation to constructor (#826)

This works around the breaking change to BackgroundService in
https://github.com/dotnet/runtime/pull/116283 which launches
ExecuteAsync using Task.Run.
This commit is contained in:
Stephen Halter 2025-10-02 12:38:13 -07:00 • committed by GitHub
commit 740a7d0346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,11 +57,7 @@ public class StreamableHttpServerConformanceTests(ITestOutputHelper outputHelper
base.Dispose();
}
#if !NET10_0
[Fact]
#else
[Fact(Skip = "https://github.com/modelcontextprotocol/csharp-sdk/issues/823")]
#endif
public async Task NegativeNonInfiniteIdleTimeout_Throws_ArgumentOutOfRangeException()
{
Builder.Services.AddMcpServer().WithHttpTransport(options =>
@ -73,11 +69,7 @@ public class StreamableHttpServerConformanceTests(ITestOutputHelper outputHelper
Assert.Contains("IdleTimeout", ex.Message);
}
#if !NET10_0
[Fact]
#else
[Fact(Skip = "https://github.com/modelcontextprotocol/csharp-sdk/issues/823")]
#endif
public async Task NegativeMaxIdleSessionCount_Throws_ArgumentOutOfRangeException()
{
Builder.Services.AddMcpServer().WithHttpTransport(options =>