Describe the bug
previously working code is not compiling anymore.
Steps To Reproduce
- have a test project with
net471 and net8.0
- have a Test Method a la:
public void RunTest()
{
int x = 1;
Assert.ThrowsExactly<DivideByZeroException>(() => GetValue(x), $"{x}"); // CS0121
Assert.Throws<DivideByZeroException>(() => GetValue(x), $"{x}"); // OK
static object GetValue(int x) => x;
}
- upgrade NuGet
MsTest from 3.8.3 to 3.9.3
Expected behavior
- solution/project compiles as before
Actual behavior
- does not compile
- need to add explicit cast/
new Action(..) to resolve
Additional context