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

Theraot.Core conflicts with Microsoft.Bcl.AsyncInterfaces package #196

Open
ig-sinicyn opened this issue Jul 3, 2023 · 2 comments
Open

Comments

@ig-sinicyn
Copy link

ig-sinicyn commented Jul 3, 2023

If the project references both Theraot.Core and Microsoft.Bcl.AsyncInterfaces packages there's Error CS0433 The type 'IAsyncEnumerable<T>' exists in both assemblies error when using the IAsyncEnumerable<T> type

NB1: the reference may be transitive. As example, SomeProject -> System.Text.Json -> Microsoft.Bcl.AsyncInterfaces.

NB2: the issue may be workarounded with aliases for unneeded assembly,

	<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" >
		<Aliases>AsyncInterfaces</Aliases>
	</PackageReference>

But it may be a good idea to use the Microsoft.Bcl.AsyncInterfaces in Theraot.Core, as it is done with Microsoft.Bcl.HashCode package

UPD: I've just discovered the IAsyncEnumerable<T> is not available when targeting net48. I'm not sure if I should report it as a separate issue as it'll be fixed automatically after referencing the Microsoft.Bcl.AsyncInterfaces. Extracted to #197

Repro:
Program.cs:

internal class Program
{
	public static void Main(string[] args)
	{
		IAsyncEnumerable<int> a = null;
	}
}

ConsoleApp.csproj:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<OutputType>Exe</OutputType>
		<TargetFramework>net461</TargetFramework>
		<ImplicitUsings>enable</ImplicitUsings>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="System.Text.Json" Version="7.0.3" />
		<PackageReference Include="Theraot.Core" Version="3.2.11" />
	</ItemGroup>
</Project>
@NN---
Copy link
Collaborator

NN--- commented Jul 3, 2023

I think we should have a separate issue for IAsyncEnumerable.

@ig-sinicyn
Copy link
Author

Will do:)

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

No branches or pull requests

2 participants