Skip to content

dotnet test --solution fails to resole path with backslash in solution filter on Linux #51521

@PhilippNaused

Description

@PhilippNaused

Repro steps:

  1. Use a repo using the new dotnet test MTP mode. ("runner": "Microsoft.Testing.Platform" in global.json)
  2. Open a solution in VS and save it as a solution filter (Example.slnf) in a different directory.
    e.g.:
{
  "solution": {
    "path": "..\\Example.slnx",
    "projects": [
      "tests\\Example.Tests.csproj"
    ]
  }
}
  1. Run tests in the new filter using dotnet test --solution <path to slnf file> in linux

Result:
This error appears: Could not find solution or directory /<path to slnf file>\Example.slnx.

VS always seems to create solution filters with backslashes in the path.
dotnet build can resolve these on linux, but dotnet test --solution ... can't.

Manually changing the path to the solution by using forward-slashes fixes this.
Also note that this is only an issue for the path to the solution file itself. There are no issue when the path to the filtered projects contain a backslash.

Using .NET SDK 10.0.100-rc.2 on Arch (WSL)

dotnet --info:

.NET SDK: Version: 10.0.100-rc.2.25502.107 Commit: 89c8f6a112 Workload version: 10.0.100-rc.2.25513.4 MSBuild version: 18.0.0-preview-25502-107+89c8f6a11

Runtime Environment:
OS Name: arch
OS Version:
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/10.0.100-rc.2.25502.107/

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.

Host:
Version: 10.0.0-rc.2.25502.107
Architecture: x64
Commit: 89c8f6a112

.NET SDKs installed:
8.0.415 [/usr/share/dotnet/sdk]
9.0.306 [/usr/share/dotnet/sdk]
10.0.100-rc.2.25502.107 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.21 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.0-rc.2.25502.107 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.21 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.0-rc.2.25502.107 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
/mnt/e/ws/Bshox/global.json

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions