Skip to content

Unable to run unit tests locally: "Could not load xunit.runner.utility.netcoreapp10" #53396

Closed
@carlossanlop

Description

@carlossanlop

When I try to run the unit tests from any csproj, I get the error I shared at the end.

Repro steps:

  • Synced my runtime enlistment to the latest bits today.
  • Built it using build clr+libs+libs.pretest -rc release.
  • Tried executing unit tests using dotnet build -c Debug /t:Test .\System.IO.FileSystem.Tests.csproj.

My environment:

  • Win10 x64
  • Latest dotnet that shows up in dotnet --list-sdks: 6.0.100-preview.5.21277.7 [C:\Program Files\dotnet\sdk]
  • Visual Studio version: 16.11.0 Preview 1.0 [31326.366.d16.11

Let me know if you need more info from me.

Microsoft (R) Build Engine version 17.0.0-preview-21274-08+9d419252d for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  System.Security.Principal.Windows -> D:\runtime\artifacts\bin\System.Security.Principal.Windows\ref\netstandard2.0-Debug\System.Security.Principal.Windows.dll
  System.Security.AccessControl -> D:\runtime\artifacts\bin\System.Security.AccessControl\ref\netstandard2.0-Debug\System.Security.AccessControl.dll
  Microsoft.Win32.Registry -> D:\runtime\artifacts\bin\Microsoft.Win32.Registry\ref\netstandard2.0-Debug\Microsoft.Win32.Registry.dll
  System.Runtime -> D:\runtime\artifacts\bin\System.Runtime\ref\net6.0-Debug\System.Runtime.dll
  System.Runtime.Extensions -> D:\runtime\artifacts\bin\System.Runtime.Extensions\ref\net6.0-Debug\System.Runtime.Extensions.dll
  System.ComponentModel -> D:\runtime\artifacts\bin\System.ComponentModel\ref\net6.0-Debug\System.ComponentModel.dll
  System.Collections -> D:\runtime\artifacts\bin\System.Collections\ref\net6.0-Debug\System.Collections.dll
  Microsoft.Win32.Primitives -> D:\runtime\artifacts\bin\Microsoft.Win32.Primitives\ref\net6.0-Debug\Microsoft.Win32.Primitives.dll
  System.Security.Principal -> D:\runtime\artifacts\bin\System.Security.Principal\ref\net6.0-Debug\System.Security.Principal.dll
  System.Runtime.InteropServices -> D:\runtime\artifacts\bin\System.Runtime.InteropServices\ref\net6.0-Debug\System.Runtime.InteropServices.dll
  System.Collections.NonGeneric -> D:\runtime\artifacts\bin\System.Collections.NonGeneric\ref\net6.0-Debug\System.Collections.NonGeneric.dll
  System.ObjectModel -> D:\runtime\artifacts\bin\System.ObjectModel\ref\net6.0-Debug\System.ObjectModel.dll
  System.Memory -> D:\runtime\artifacts\bin\System.Memory\ref\net6.0-Debug\System.Memory.dll
  System.ComponentModel.Primitives -> D:\runtime\artifacts\bin\System.ComponentModel.Primitives\ref\net6.0-Debug\System.ComponentModel.Primitives.dll
  System.Net.Primitives -> D:\runtime\artifacts\bin\System.Net.Primitives\ref\net6.0-Debug\System.Net.Primitives.dll
  System.Collections.Specialized -> D:\runtime\artifacts\bin\System.Collections.Specialized\ref\net6.0-Debug\System.Collections.Specialized.dll
  System.Net.WebSockets -> D:\runtime\artifacts\bin\System.Net.WebSockets\ref\net6.0-Debug\System.Net.WebSockets.dll
  System.Security.Claims -> D:\runtime\artifacts\bin\System.Security.Claims\ref\net6.0-Debug\System.Security.Claims.dll
  System.Security.Principal.Windows -> D:\runtime\artifacts\bin\System.Security.Principal.Windows\ref\net6.0-Debug\System.Security.Principal.Windows.dll
  System.Security.AccessControl -> D:\runtime\artifacts\bin\System.Security.AccessControl\ref\net6.0-Debug\System.Security.AccessControl.dll
  TestUtilities -> D:\runtime\artifacts\bin\TestUtilities\net6.0-Debug\TestUtilities.dll
  StreamConformanceTests -> D:\runtime\artifacts\bin\StreamConformanceTests\net6.0-Debug\StreamConformanceTests.dll
  System.IO.FileSystem.Tests -> D:\runtime\artifacts\bin\System.IO.FileSystem.Tests\net6.0-windows-Debug\System.IO.FileSystem.Tests.dll
  ----- start 2021-05-27 17:55:43.09 ===============  To repro directly: =====================================================
  pushd D:\runtime\artifacts\bin\System.IO.FileSystem.Tests\net6.0-windows-Debug\
  "D:\runtime\artifacts\bin\testhost\net6.0-windows-Debug-x64\dotnet.exe" exec --runtimeconfig System.IO.FileSystem.Tests.runtimeconfig.json --depsfile System.IO.FileSystem.Tests.deps.json xunit.console.dll System.IO.FileSystem.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing
  popd
  ===========================================================================================================
  Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'xunit.runner.utility.netcoreapp10, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'. The system cannot find the file specified.
  File name: 'xunit.runner.utility.netcoreapp10, Version=2.4.1.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'
     at Xunit.ConsoleClient.ConsoleRunner..ctor(Object consoleLock)
     at Xunit.ConsoleClient.Program.Main(String[] args) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/Program.cs:line 16
  ----- end 2021-05-27 17:55:48.02 ----- exit code -532462766 ----------------------------------------------------------
D:\runtime\eng\testing\tests.targets(125,5): error : One or more tests failed while running tests from 'System.IO.FileSystem.Tests'. [D:\runtime\src\libraries\System.IO.FileSystem\tests\System.IO.FileSystem.Tests.csproj]

Build FAILED.

@Anipik @ericstj @ViktorHofer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions