BUG: To work around an occasional issue using dotnet test
on non-Windows
platforms with .NET Framework, we have updated the NuGet package to include a dependency for
Microsoft.TestPlatform.ObjectModel.
Normally this should not be necessary, as this dependency should be provided by VSTest, but on occasion
tests will fail to run with the following error:
Catastrophic failure: System.TypeLoadException: Could not load type of field 'Xunit.Runner.VisualStudio.VsExecutionSink:recorder'
(3) due to: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
At this point in time, it's unclear what circumstances this happens under, but hopefully the dependency here should resolve the issue.
(The ideal fix would be to updateMicrosoft.NET.Test.Sdk
to include Microsoft.TestPlatform.ObjectModel
as a dependency, which it already does for .NET/.NET Core but does not for .NET Framework. Unfortunately, Microsoft
has marked the linked issue below as "Won't Fix" despite evidence of several projects referencing it, having to fix
the problem on their own. Even if they fix it, our change will help people who may end up still referencing an older
version of Microsoft.NET.Test.Sdk
, as it's not clear how often people will update this dependency in
their projects.)
microsoft/vstest#2469