Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netstandard 2.0 build depends on Microsoft.Bcl.Memory causing conflict with Indexes provided by IndexRange #3099

Open
caspChristian opened this issue Jan 21, 2025 · 0 comments

Comments

@caspChristian
Copy link

caspChristian commented Jan 21, 2025

Which version of Microsoft.IdentityModel are you using?
Microsoft.IdentityModel.Tokens 8.3.1

Where is the issue?
Microsoft.IdentityModel.Tokens 8.3.1 netstandard 2.0 build Depends on Microsoft.Bcl.Memory

Is this a new or an existing app?
Existing app, Api .Net 4.7.2, working fine with Microsoft.IdentityModel.Tokens 8.3.0

Repro
Using IndexRange to provide support for language features of index, especially

var aList = someArray.ToList();
string last = actions[^1];  // <<<<<

Also see bgrainger/IndexRange#14

Expected behavior
Everything compiling without issues, and no major change since it is only a minor version change. (trying to be optimistic at times)
(Also wouldn't expect Microsoft.Bcl.Memory to break IndexRange usage, but that might be a more difficult issue to resolve.)
Change of package use would be nice to have in release notes with explanation.
Introduced in #2817

Actual behavior
Compile time errors

CS0656 Missing compiler required member 'System.Index..ctor'
CS0518 Predefined type 'System.Index' is not defined or imported
CS0518 Predefined type 'System.Range' is not defined or imported

Possible solution
Is Microsoft.Bcl.Memory required as a dependency in netstandard builds?

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">

Current workaround
Block version 8.3.1 and later

@caspChristian caspChristian changed the title [Bug] netstandard 2.0 build depends on Microsoft.Bcl.Memory causing conflict with Indexes provided by IndexRange Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant