dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

Misleading build error with no traces in binlog when MAUI workloads are not installed #38501

Open etvorun opened 8 months ago

etvorun commented 8 months ago
  1. Create new Virtual Machine (or get clean machine somehow else).
  2. Install Visual Studio latest preview. During install select just one workload ".NET Desktop Development". DO NOT include MAUI workloads.
  3. Create Sample.csproj file with the content below.
  4. Open developer prompt and run msbuild Sample.csproj /t:Restore /bl. Actual: error NETSDK1147: To build this project, the following workloads must be installed: maui-tizen. Binlong contains no traces explaining why maui-tizen is needed. Expected: error stating that maui-windows workload is missing. And some binlog traces explaining the logic aboud missing workspaces
<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFrameworks>net8.0-windows10.0.19041.0</TargetFrameworks>
        <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
        <OutputType>WinExe</OutputType>
        <RuntimeIdentifier>win10-x86</RuntimeIdentifier>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
    </PropertyGroup>
</Project>
marcpopMSFT commented 7 months ago

@etvorun do you happen to have an https://aka.ms/binlog of the error?

@Forgind you may need to install tizen to reproduce this. We have an algorithm that is supposed to determine the minimum workload required for the missing packs reported. We've seen other issues like this so maybe the algorithm needs some investigation.

Potentially also we should deprioritize -experimental workloads but that's not related to the correctness of this algorithm which is trying to do a graph lookup.