XUnit tests failing after .NET8 upgrade

·

1 min read

A note to future me. After upgrading an Azure Functions project from .NET6 to .NET8. XUnit tests stopped running with an exception

An exception occurred while invoking executor 
'executor://xunit/VsTestRunner2/netcoreapp': Method 'LogRaw' in type 
'Xunit.Runner.VisualStudio.VisualStudioRunnerLogger' from assembly 
'xunit.runner.visualstudio.dotnetcore.testadapter, Version=2.4.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' 
does not have an implementation. Stack trace:...

and the stack trace was just helpful but being cryptic.

The Fix:

A simple yet elusive step: remove all bin and obj folders. Once cleared, the tests ran like clockwork again :)