Skip to content

Running dotnet test fails with System.ComponentModel.Win32Exception (SDK 10.0.101) #7121

@0xced

Description

@0xced

Describe the bug

After upgrading from the .NET SDK 10.0.100 to 10.0.101, running tests started to completely fail.

Steps To Reproduce

  1. Make sure that both the .NET SDK version 10.0.100 and 10.0.101 are installed to be able to fully reproduce.

  2. Clone the https://github.com/0xced/nugraph repository with submodules

git clone --recurse-submodules https://github.com/0xced/nugraph
  1. Ensure that the commit is 26c592425f5b0310e6359e091681d2e121e9e9d0
cd nugraph
git checkout 26c592425f5b0310e6359e091681d2e121e9e9d0
  1. Ensure that the SDK version 10.0.100 is used
dotnet --version
10.0.100
  1. Configure for Release through the Configuration environment variable
export Configuration=Release
  1. Run the tests
dotnet test

The output should look like this:

Running tests from tests/nugraph.Tests/bin/Release/net8.0/nugraph.Tests.dll (net8.0|arm64)
tests/nugraph.Tests/bin/Release/net8.0/nugraph.Tests.dll (net8.0|arm64) passed (10s 500ms)

Test run summary: Passed!
  total: 30
  failed: 0
  succeeded: 30
  skipped: 0
  duration: 5s 561ms
  1. Edit the global.json file and update the .NET SDK version to 10.0.101. It should now be this:
{
    "$schema": "https://www.schemastore.org/global.json",
    "sdk": {
        "version": "10.0.101"
    },
    "test": {
        "runner": "Microsoft.Testing.Platform"
    }
}
  1. Run the tests again
git clean -fdx
dotnet test

Expected behavior

The tests pass, just like with the SDK version 10.0.100

Actual behavior

The tests completely fail.

The following exception occurred when running the test module with RunCommand '/home/runner/work/nugraph/nugraph/tests/nugraph.Tests/bin/Debug/net8.0/nugraph.Tests' and RunArguments ' --report-trx --report-trx-filename TestResults-net8.0.trx --results-directory /home/runner/work/nugraph/nugraph':

System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/home/runner/work/nugraph/nugraph/tests/nugraph.Tests/bin/Debug/net8.0/nugraph.Tests' with working directory '/home/runner/work/nugraph/nugraph'. No such file or directory
   at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.DotNet.Cli.Commands.Test.TestApplication.RunAsync()
   at Microsoft.DotNet.Cli.Commands.Test.TestApplication.RunAsync()
   at Microsoft.DotNet.Cli.Commands.Test.TestApplicationActionQueue.Read(BuildOptions buildOptions, TestOptions testOptions, TerminalTestReporter output, Action`1 onHelpRequested)

Test run summary: Zero tests ran
  total: 0
  failed: 0
  succeeded: 0
  skipped: 0
  duration: 14ms
Test run completed with non-success exit code: 1 (see: https://aka.ms/testingplatform/exitcodes)

Additional context

GitHub actions:
✅ With SDK 10.0.100: https://github.com/0xced/nugraph/actions/runs/20195006748
❌ With SDK 10.0.101: https://github.com/0xced/nugraph/actions/runs/20194237078

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: MTPBelongs to the Microsoft.Testing.Platform core library

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions