Home > Blockchain >  Unit Tests fail after upgrade to .NET 6.0
Unit Tests fail after upgrade to .NET 6.0

Time:06-30

We recently upgraded from .NET Framework 4.6 to .NET (6.0). When try to run unit tests in Test-Explorer, it starts to build and then stops without further notice. In the output-window under "test" i see lots of errors (one for every test-project):

Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Could not find testhost

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable1 sources, IDictionary2 environmentVariables, TestRunnerConnectionInfo connectionInfo)

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)

at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)

More informations: Visual studio 2019, upgrade-assistant changed the previous test suite to xunit.

CodePudding user response:

Some NuGet-packages were missing. I needed in the end:

  • Microsoft.NET.Test.Sdk
  • xunit
  • xunit.runner.visualstudio

enter image description here

  • Related