You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D:\a\mtp-msbuild-repro\mtp-msbuild-repro\bin\Debug\net8.0\mtp-msbuild-repro.dll : error run failed: Tests failed: Possible reasons for this include: [D:\a\mtp-msbuild-repro\mtp-msbuild-repro\mtp-msbuild-repro.csproj]
D:\a\mtp-msbuild-repro\mtp-msbuild-repro\bin\Debug\net8.0\mtp-msbuild-repro.dll : error run failed: Could not execute because the specified command or file was not found. [D:\a\mtp-msbuild-repro\mtp-msbuild-repro\mtp-msbuild-repro.csproj]
D:\a\mtp-msbuild-repro\mtp-msbuild-repro\bin\Debug\net8.0\mtp-msbuild-repro.dll : error run failed: * You misspelled a built-in dotnet command. [D:\a\mtp-msbuild-repro\mtp-msbuild-repro\mtp-msbuild-repro.csproj]
D:\a\mtp-msbuild-repro\mtp-msbuild-repro\bin\Debug\net8.0\mtp-msbuild-repro.dll : error run failed: * You intended to execute a .NET program, but dotnet---internal-msbuild-node does not exist. [D:\a\mtp-msbuild-repro\mtp-msbuild-repro\mtp-msbuild-repro.csproj]
D:\a\mtp-msbuild-repro\mtp-msbuild-repro\bin\Debug\net8.0\mtp-msbuild-repro.dll : error run failed: * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH. [D:\a\mtp-msbuild-repro\mtp-msbuild-repro\mtp-msbuild-repro.csproj]
D:\a\mtp-msbuild-repro\mtp-msbuild-repro\bin\Debug\net8.0\mtp-msbuild-repro.dll : error run failed: [D:\a\mtp-msbuild-repro\mtp-msbuild-repro\mtp-msbuild-repro.csproj]
Additional context
I think I've narrowed the problem down to the name of the executable "MSBuild.exe".
On the repro there is a GitHub Action Workflow that proves this by: renaming the executable from "MSBuild.exe" to "dotnet.exe" and then running dotnet.exe -restore -t:Build;Test mstest.csproj, the tests run successfully.
Describe the bug
An MSTest.Sdk project cannot be tested with "VS MSBuild" (or "Full MSBuild").
Steps To Reproduce
On a Windows machine with "VS MSBuild" and dotnet SDK installed:
You can also see the repro: https://github.com/RuiAlias/mtp-msbuild-repro. On this repro I created a GitHub Actions Workflow that runs the msbuild command and fails: https://github.com/RuiAlias/mtp-msbuild-repro/actions/runs/11858511987/job/33049304509.
Expected behavior
MSBuild.exe
runs the tests successfully.Actual behavior
MSBuild.exe
fails with error:Additional context
I think I've narrowed the problem down to the name of the executable "MSBuild.exe".
testfx/src/Platform/Microsoft.Testing.Platform.MSBuild/Tasks/InvokeTestingPlatformTask.cs
Line 191 in 7eade67
On the repro there is a GitHub Action Workflow that proves this by: renaming the executable from "MSBuild.exe" to "dotnet.exe" and then running
dotnet.exe -restore -t:Build;Test mstest.csproj
, the tests run successfully.dotnet test mstest.csproj
worksdotnet msbuild -restore -t:Build;Test mstest.csproj
worksMSBuild.exe -restore -t:Build;Test mstest.csproj
failsmv MSBuild.exe dotnet.exe; dotnet.exe -restore -t:Build;Test mstest.csproj
workshttps://github.com/RuiAlias/mtp-msbuild-repro/blob/main/.github/workflows/build-and-test.yml
The text was updated successfully, but these errors were encountered: