Here is a head scratcher. We've started adding the RowVersion property to our DB types and response DTOs for optimistic concurrency. Our test setup is async and is called via the SetUp attribute. Before adding the RowVersion property these tests ran fine after adding the RowVersion attribute we get an exception "System.InvalidOperationException : The current SynchronizationContext may not be used as a TaskScheduler." I've created this repro to show the issue.

Thanks,Deon

mythz
—
2019-01-02T19:35:32Z —
#2

I'd avoid using async in NUnit setup code in general, but you would need to use [OneTimeSetUp]: