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

System.Interactive.Async causes compile error for IAsyncEnumerable on .NET Core 3.0 #14239

Closed
jnm2 opened this issue Dec 23, 2018 · 5 comments
Closed

Comments

@jnm2
Copy link

jnm2 commented Dec 23, 2018

If you reference the type IAsyncEnumerable in a .NET Core 3.0 project that references Entity Framework Core, System.Interactive.Async causes a compile error:

CS0433 The type 'IAsyncEnumerable<T>' exists in both 'System.Interactive.Async, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' and 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <LangVersion>8.0</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.0" />
  </ItemGroup>

</Project>

Is there any chance that this has already been addressed in a preview feed of Entity Framework Core or System.Interactive.Async?

@jnm2 jnm2 changed the title EF Core System.Interactive.Async causes compile error for IAsyncEnumerable on .NET Core 3.0 Dec 23, 2018
@ajcvickers ajcvickers added this to the 3.0.0 milestone Jan 4, 2019
@divega
Copy link
Contributor

divega commented Jan 4, 2019

@jnm2 This is a point in time issue that should go away once we implement #12047. We haven't started on that yet, and we are still in fact discussing how we are going to approach it.

It is possible that upgrading the System.Interactive.Async dependency to a newer version will be part of the solution, but even this isn't certain yet.

In the meantime, you can use full namespace (or namespace aliasing) to deambiguate. I will close this issue as duplicate of #12047.

@divega divega closed this as completed Jan 4, 2019
@divega divega removed their assignment Jan 4, 2019
@divega divega removed this from the 3.0.0 milestone Jan 4, 2019
@smitpatel
Copy link
Contributor

@jnm2
Copy link
Author

jnm2 commented Jan 4, 2019

@divega Great to know it's getting attention! No hurry since it's a preview. I'll subscribe to that issue so I know when the friction is gone for this project.

I don't think using a full namespace will disambiguate, by the way. This isn't the first time I'm had to hack up something just like https://github.com/aspnet/EntityFrameworkCore/blob/master/Directory.Build.targets and add extern aliases to loads of source files, so I now give that whole experience a very respectful berth.

@divega
Copy link
Contributor

divega commented Jan 7, 2019

@jnm2 you are right, namespace aliasing isn't enough. Thanks @smitpatel for the assist.

@holajan
Copy link

holajan commented Jan 14, 2020

I recently had similar problem, with my netcoreapp3.1 project using EntityFrameworkCore (3.1.0) and IAsyncEnumerable interface.
My build ended with this error:

error CS0433: The type 'IAsyncEnumerable' exists in both 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

In my case the problem was caused by using nuget restore command (not dotnet restore) and I had old version of nuget.exe. Upgrading to latest nuget.exe fixed the build.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
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

5 participants