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 dependency breaks .NET Core 3.0 IAsyncEnumerator in .NET Core 3.0 preview 3 #15047

Closed
Zenexer opened this issue Mar 15, 2019 · 12 comments

Comments

@Zenexer
Copy link

@Zenexer Zenexer commented Mar 15, 2019

Currently, Microsoft.EntityFrameworkCore 3.0.0-preview3.19153.1 requires System.Interactive.Async 3.2.0. However, both System.Interactive.Async 3.2.0 and .NET Core 3.0 provide System.Collections.Generic.IAsyncEnumerator`1, preventing projects that use IAsyncEnumerator from building:

Severity Code Description Project File Line Suppression State
Error CS0433 The type 'IAsyncEnumerator' exists in both 'System.Interactive.Async, Version=3.2.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' and 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Test.Services E:\Source\Test\Test\Test.Services\Import\Enumerator\AgnosticEnumerator.cs 10 Active

@Zenexer Zenexer changed the title System.Interactive.Async dependency breaks IAsyncEnumerator System.Interactive.Async dependency breaks .NET Core 3.0 IAsyncEnumerator in .NET Core 3.0 preview 3 Mar 16, 2019
@Zenexer

This comment has been minimized.

Copy link
Author

@Zenexer Zenexer commented Mar 16, 2019

Forcefully adding a dependency for System.Interactive.Async >= 4.0.0-preview* works around the issue, but I don't think it makes sense for EF Core 3.0.0-preview* to depend on System.Interactive.Async >= 3.2.0 when it really needs >= 4.0.0-preview*.

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Mar 18, 2019

@smitpatel to follow up.

@smitpatel

This comment has been minimized.

Copy link
Member

@smitpatel smitpatel commented Mar 18, 2019

Duplicate of #14239

The thread has steps to get it to work.

@smitpatel

This comment has been minimized.

Copy link
Member

@smitpatel smitpatel commented Mar 18, 2019

For the 2nd comment duplicate of #14906

@lucaswalter

This comment has been minimized.

Copy link

@lucaswalter lucaswalter commented Oct 25, 2019

I am still currently running into this issue with EF Core 3.0. Is the suggested solution still to forcefully update System.Interactive.Async >= 4.0.0?

@shelbypereira

This comment has been minimized.

Copy link

@shelbypereira shelbypereira commented Oct 29, 2019

I also have this issue in Core 3.0.

forcefully updating to System.Interactive.Async 4.0.0 only helped partially. The error went away, but now I have another error:
Reference to type 'IAsyncEnumerable<>' claims it is defined in 'System.Interactive.Async', but it could not be found

I have a test class:
internal class TestAsyncQueryProvider : IAsyncQueryProvider

and it seems that IAsyncQueryProvider is causing the issue.

NOTE: I also tried forceably updating to System.Runtime 4.3.1 which did not help.

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Oct 29, 2019

@shelbypereira Make sure that older versions of the IX package is not being referenced from somewhere. Likewise, make sure that all EF/Extensions/ASP.NET packages are updated to 3.0 versions. Also, be aware that starting with .NET Core 3.0, some types are now implemented by the .NET Core base class library due do support for async enumerations in the C# 8 compiler.

@shelbypereira

This comment has been minimized.

Copy link

@shelbypereira shelbypereira commented Oct 30, 2019

Thanks, your sugestion works, I actually did not have EF Core referenced, it seems I did not need it in .net Core, adding the reference to EF 3.0 worked.

@ZombiesWithCoffee

This comment has been minimized.

Copy link

@ZombiesWithCoffee ZombiesWithCoffee commented Nov 6, 2019

Once I added System.Interactive.Async 4.0 - I now get

TypeLoadException: Could not load type 'System.Collections.Generic.IAsyncEnumerable`1' from assembly 'System.Interactive.Async, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'.

@AnotherZane

This comment has been minimized.

Copy link

@AnotherZane AnotherZane commented Nov 9, 2019

Once I added System.Interactive.Async 4.0 - I now get

TypeLoadException: Could not load type 'System.Collections.Generic.IAsyncEnumerable`1' from assembly 'System.Interactive.Async, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'.

Same thing happens to me

@Donis-

This comment has been minimized.

Copy link

@Donis- Donis- commented Nov 20, 2019

For runtime error "TypeLoadException: Could not load type 'System.Collections.Generic.IAsyncEnumerable`1' from assembly 'System.Interactive.Async, Version=4.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'."

Remove the explicit addition of dependency to System.Interactive.Async 4.0 (as it does not have the type anymore and indirectly references it from Microsoft.Bcl.AsyncInterfaces)

And add to .csproj:

  <Target Name="AddAssemblyAliasToReactiveAsync"
          AfterTargets="ResolveAssemblyReferences">
    <ItemGroup>
      <ReferencePath Condition=" '%(FileName)' == 'System.Interactive.Async' ">
        <Aliases>reactive</Aliases>
      </ReferencePath>
    </ItemGroup>
  </Target>

Inspired by comment in #14239, and corresponding reference to:
https://github.com/aspnet/EntityFrameworkCore/blob/v3.0.0-preview4.19216.3/Directory.Build.targets

@rui-ktei

This comment has been minimized.

Copy link

@rui-ktei rui-ktei commented Jan 13, 2020

I came across this error just now. I'm using .netcoreapp3.1 and simply using IAsyncEnumerable interface gave me this error straightaway. If I'm not missing anything here then this error is kinda embarrassing for a production .net core release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.