Microsoft.Bcl.TimeProvider 8.0.1 contains incorrect linker substitution resources

Open
#109,163 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
build-system

Research direction

Inspect the Microsoft.Bcl.TimeProvider 8.0.1 assembly and its embedded ILLink.Substitutions.xml resource, then reproduce publishing for net8.0-macos or net8.0-ios. Done means the package's linker substitutions resolve correctly and publishing no longer reports IL2008 or IL2040.

Written by the indexing model from the issue text.

Description

area-System.DateTime linkable-framework

Microsoft.IdentityModel.Tokens recently added a dependency on Microsoft.Bcl.TimeProvider 8.0.1 which uncovered a publishing error. The package contains Microsoft.Bcl.TimeProvider.dll for .NET 8 that contains an ILLink.Substitutions.xml resource with the following content:

<linker>
  <assembly fullname="Microsoft.Bcl.TimeProvider" feature="System.Resources.UseSystemResourceKeys" featurevalue="true">
    <!-- System.Resources.UseSystemResourceKeys removes resource strings and instead uses the resource key as the exception message -->
    <resource name="FxResources.Microsoft.Bcl.TimeProvider.SR.resources" action="remove" />
    <type fullname="System.SR">
      <method signature="System.Boolean UsingResourceKeys()" body="stub" value="true" />
    </type>
  </assembly>
</linker>

There are, however, no other resources in the .dll and the script generates the following errors during publish:

resource ILLink.Substitutions.xml in Microsoft.Bcl.TimeProvider, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51(5,6): error IL2008: Microsoft.Bcl.TimeProvider: Could not resolve type 'System.SR'. [/Users/teamcity/actions-runner/_work/emclient/emclient/MailClient/MailClient.csproj::TargetFramework=net8.0-macos]
resource ILLink.Substitutions.xml in Microsoft.Bcl.TimeProvider, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51(4,6): error IL2040: Microsoft.Bcl.TimeProvider: Could not find embedded resource 'FxResources.Microsoft.Bcl.TimeProvider.SR.resources' to remove in assembly 'Microsoft.Bcl.TimeProvider'. [/Users/teamcity/actions-

This affects all the net8.0-macos / net8.0-ios builds because they run ILLink as part of the build process.

It seems that the 9.0.0-rc.2.24473.5 version of the package doesn't suffer from this authoring issue. Is it safe to migrate to the new version? What's the guidance for bumping the NuGet version number in transitive references? Should I suggest the Azure AD team (https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet) to bump the dependency to the 9.0.0-rc2 version? /cc @FuPingFranco

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.