Skip to content

2.1 Reference resolution project fails to add patched CoreFx assembly to Microsoft.Aspnetcore.App #30279

Closed
@wtgodbe

Description

@wtgodbe

In 2.1.26, we found that, despite CoreFx shipping a new version of System.Text.Encodings.Web, we failed to include the new version of the binary in Microsoft.Aspnetcore.App``. The reason for this is that the we didn't patch any of the 3 projects that depend on S.T.E.W, so all references to it were resolved as BaselinePackageReferences, which still point to the unpatched version. I found this by examining the binlog and noticing that, despite `SystemTextEncodingsWebPackageVersion` being updated to 4.5.0, all of the resolved `PackageReferences` to it had version 4.5.0, and were coming from our `ResolveCustomReferences` target. We should fix our logic so that the SharedFx always gets the latest version of any assembly coming from repos below us.

Strangely, this behavior was not present for at least one recent ingestion of a patched CoreFx library. System.IO.Pipelines was patched in the 2.1.23 build, and we did not ship any patched packages, but Microsoft.AspNetCore.App did include the latest version of System.IO.Pipelines. I haven't figured out why it worked then but not now.

Original text from email:

My working theory is that we’re actually resolving this dependency from our package baseline, where its version is [4.5.0, ]. The only projects we have that reference S.T.E.W all have it listed as BaselinePackageReferences in our baseline, so they all resolve it from there, and get the 4.5.0 version – nothing is restoring it as an external reference with the 4.5.1 version, So it’s the 4.5.0 version that actually gets restored. See these 3 projects which are the only ones that reference S.T.E.W:

<Reference Include="System.Text.Encodings.Web" />

<Reference Include="System.Text.Encodings.Web" />

<Reference Include="System.Text.Encodings.Web" />

And their baseline entries, which list a BaselinePackageReference to S.T.E.W at 4.5.0 or higher:

<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Html.Abstractions' AND '$(TargetFramework)' == 'netstandard2.0' ">
<BaselinePackageReference Include="System.Text.Encodings.Web" Version="[4.5.0, )" />

<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.Http.Abstractions' AND '$(TargetFramework)' == 'netstandard2.0' ">
<BaselinePackageReference Include="Microsoft.AspNetCore.Http.Features" Version="[2.1.1, )" />
<BaselinePackageReference Include="System.Text.Encodings.Web" Version="[4.5.0, )" />

<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.WebUtilities' AND '$(TargetFramework)' == 'netstandard2.0' ">
<BaselinePackageReference Include="Microsoft.Net.Http.Headers" Version="[2.1.1, )" />
<BaselinePackageReference Include="System.Text.Encodings.Web" Version="[4.5.0, )" />

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions