Skip to content

Conversation

@danielcweber
Copy link
Collaborator

@danielcweber danielcweber commented May 19, 2023

Bugfix

A change in a2410b2 added net6.0, bumped to net48 and dropped netcoreapp3.1 for System.Linq.Async. As a consequence, the condition on which a reference to Microsoft.Bcl.AsyncInterfaces is taken proves no longer useful. This results in the package reference being present on net6.0 (and beyond) when it should not be.

This commit rewrites the condition.

Fixes #1834.

…that it will take the dependency on explicitly specified target frameworks rather than a negation of frameworks, which fails as soon as new target frameworks are added.
danielcweber added a commit to Gremlinq/ExRam.Gremlinq that referenced this pull request May 19, 2023
… due to a bug (dotnet/reactive#1941) and the utilized operators are rather trivial to re-implement here. The dll is over 1MB.

<ItemGroup>
<PackageReference Condition="'$(TargetFramework)' != 'netcoreapp3.1' and '$(TargetFramework)' != 'netstandard2.1' " Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Condition="'$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'netstandard2.0' " Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we only want to include this package reference on non-.NET Core targets, the idiomatic condition would be:

Suggested change
<PackageReference Condition="'$(TargetFramework)' == 'net48' or '$(TargetFramework)' == 'netstandard2.0' " Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Condition=" '$(TargetFrameworkIdentifier)' != '.NETCoreApp' " Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />

Note that net5.0, net6.0, etc fall under .NETCoreApp too.

See some examples of this condition in the dotnet/runtime repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll give us the reference on .netstandard 2.1 as well which we do not want:

image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

danielcweber added a commit to Gremlinq/ExRam.Gremlinq that referenced this pull request May 19, 2023
… due to a bug (dotnet/reactive#1941) and the utilized operators are rather trivial to re-implement here. The dll is over 1MB.
@danielcweber
Copy link
Collaborator Author

Just realized #1719 also fixes the issue. Closing in favor of #1719.

@danielcweber
Copy link
Collaborator Author

Fixed by #1719.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dependency on Microsoft.Bcl.AsyncInterfaces for net6.0

2 participants