Skip to content

[Microsoft.Build.Traversal] Behavior is differrent, incorrect under net7.0 #412

@heaths

Description

@heaths

We are upgrading the Azure SDK for .NET to target net7.0 and net6.0 TFMs (and net461 on Windows). After changing our global.json to "7.0.100" and setting (effectively) <TargetFrameworks>net7.0;net6.0</TargetFrameworks>, I've noticed that loggers and properties are not being passed to inner builds.

Currently, we are using Microsoft.Build.Traversal 3.0.23 but even after upgrading to 3.2.0 it still doesn't work.

See Azure/azure-sdk-for-net#32814 (comment) for some details, but where we noticed this was that we pass /p:EnableSourceLink=false (and a bunch of other properties) but it was failing in our sparse checkout (known separate issue).

For example, in https://github.com/Azure/azure-sdk-for-net, this exact command line exhibits very different behaviors:

net6.0

dotnet test eng/service.proj --filter "(TestCategory!=Manually) & (TestCategory!=Live) & (Placeholder!=DefaultIgnoreMe)" --framework net6.0 --logger "trx;LogFileName=net6.0.trx" --logger:"console;verbosity=normal" -bl:"$PWD\msbuild.binlog" --blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout 100minutes /p:SDKType=all /p:ServiceDirectory=keyvault /p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:RunApiCompat=false /p:InheritDocEnabled=false /p:Configuration=Debug /p:CollectCoverage=false /p:EnableSourceLink=false /p:ProjectListOverrideFile= /p:UseProjectReferenceToAzureClients=false

  1. Builds only packages under sdk/keyvault/ and those on which they depend e.g., sdk/core/Azure.Core/src/Azure.Core.csproj.
  2. Doesn't yield errors about invalid repo version (since we use sparse checkouts in some pipelines, which uses repo version 1, which causes Microsoft.Build.Tasks.Git to panic).

net7.0

exact same command line

  1. Builds all packages under sdk/ (because the filter property isn't being passed down).
  2. Yields errors because of the Microsoft.Build.Tasks.Git issue hopefully getting fixed in Add sparse checkout support dotnet/sourcelink#772.

I can't get you a binlog because however -bl is handled in inner builds (or even the outer?) is not taking effect: no binlog is generated under net7.0. It gets generated fine under net6.0 and does contain information about every package (filtered list) built.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions