dotnet / dotnet/arcade

Arcade build infra gives an ambiguous error message with invalid solution filter files

Open
#7,395 1 comment 0 reactions 0 assignees View on GitHub
dev-workflow
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

This issue was discovered in the SDK repo with this [PR](https://github.com/dotnet/sdk/pull/17417#issuecomment-839913587).

**Steps to Reproduce**
1. Pull the [SDK repo](https://github.com/dotnet/sdk)
2. Open the [source-build.slnf](https://github.com/dotnet/sdk/blob/main/source-build.slnf) file and change one of the project paths to be invalid. e.g. add 'foo' to the beginning of a project path.
3. Build the slnf with arcade - `./eng/common/build.sh --build --restore --projects /repos/sdk/source-build.slnf`

**Actual Results**
```
/repos/sdk/source-build.slnf(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
```

**Expected Results**
When you build the project with the .net CLI the error message clearly indicates the slnf file contains an invalid project path. I would expect the same when building with Arcade.

```console
# ./.dotnet/dotnet build source-build.slnf
Microsoft (R) Build Engine version 16.10.0-preview-21215-05+369631b4b for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

/repos/sdk/src/Foo/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj : Solution file error MSB5028: Solution filter file at "/repos/sdk/source-build.slnf" includes project "src/Foo/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj" that is not in the solution file at "/repos/sdk/sdk.sln".

Build FAILED.

/repos/sdk/src/Foo/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj : Solution file error MSB5028: Solution filter file at "/repos/sdk/source-build.slnf" includes project "src/Foo/DotNetDeltaApplier/Microsoft.Extensions.DotNetDeltaApplier.csproj" that is not in the solution file at "/repos/sdk/sdk.sln".
0 Warning(s)
1 Error(s)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.