diff --git a/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs b/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs index 95e309e..a2583c9 100644 --- a/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs +++ b/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs @@ -28,7 +28,7 @@ public void Dispose() { _mongoTestServer.Dispose(); } - catch(ObjectDisposedException) + catch(AggregateException ex) when(ex.GetBaseException().GetType() == typeof(ObjectDisposedException)) { /* It's for some reason, disposing MongoTestServer can give us ObjectDisposedException. I have only