dotnet / arcade

Tools that provide common build infrastructure for multiple .NET Foundation projects.
MIT License
672 stars 349 forks source link

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

Open MichaelSimons opened 3 years ago

MichaelSimons commented 3 years ago

This issue was discovered in the SDK repo with this PR.

Steps to Reproduce

  1. Pull the SDK repo
  2. Open the 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.

# ./.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)
markwilkie commented 3 years ago

Thanks @MichaelSimons - adding to our Arcade backlog. (it's kinda big right now....)