question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.Interactive.Async dependency is problematic (transitive)

See original GitHub issue

Currently, the lib takes a transitive dependency on System.Interactive.Async v3.2.0" via Grpc.Core.

This is problematic because it defines IAsyncEnumerable<T> etc, which means that anyone taking a dep on this lib cannot use async-enumerable:

error CS0433: The type ‘IAsyncEnumerable<T>’ 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’

The ideal fix here would be if there was a preview of Grpc.Core that took a dep on v4.0.0 (preview); as I understand it, v4.0.0 unifies the types to avoid this problem - but of course v4.0.0 is preview as long as core 3 is preview; so it would need to be a preview of Grpc.Core too, etc. But that’s probably all correct.

The main point of this issue is to make it explicit that it would be a bad idea to release Grpc-Dotnet with it taking a transitive dependency that breaks async enumerables.

Of course, if we can co-ordinate with Grpc.Core to get a preview build that works correctly with them, that’s even better - it would allow a full test of more scenarios, and would prevent the risk of accidentally deploying with a dangerously broken API.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
JamesNKcommented, Jun 14, 2019

Put this in your csproj:

  <!--
    System.Interactive.Async contains IAsyncEnumerable<T> that conflicts with .NET Core version
    Give assembly an alias so .NET Core version can be referenced in C#
  -->
  <Target Name="ChangeAliasesOfReactiveExtensions" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences">
    <ItemGroup>
      <ReferencePath Condition="'%(FileName)' == 'System.Interactive.Async'">
        <Aliases>ix</Aliases>
      </ReferencePath>
    </ItemGroup>
  </Target>
1reaction
mgravellcommented, Jun 14, 2019

In case you’re wondering about the context here: my code-first stuff implements API re-shaping. The following already works:

    [ServiceContract(Name = "Greet.Greeter")]
    public interface IGreeter
    {
        ValueTask<HelloReply> SayHelloAsync(HelloRequest request);
    }

but I’d ideally like it to also work to detect client/server/duplex streaming APIs via IAsyncEnumerable<T>, i.e.

IAsyncEnumerable<SomeReply> FullDuplex(IAsyncEnumerable<SomeRequest> whatever);

I can’t begin to look at this as long as the transitive dependency problem is there.

(the key point of API re-shaping is that it allows a single interface to be shared at both client and server, with the server implementing the interface, and the client getting a proxy; i.e. my server here is a class SomeServer : IGreeter)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load file or assembly 'System.Interactive.Async ...
I'm having an issue with client-side streaming in C#. When my client code in a VSIX package tries to call a service that...
Read more >
Solving Transitive Dependency Issues in .NET Core
Transitive dependency issues can be hard to identify and solve. Here's my unscientific approach to fixing them.
Read more >
Learning the Basics
You can customize Gradle's handling of transitive dependencies based on the requirements of a project. Projects with hundreds of declared dependencies can ...
Read more >
dart pub outdated
Use dart pub outdated to help you update your package dependencies. ... You might still have out-of-date dependencies due to transitive dependencies.
Read more >
Package dependencies
Pub handles transitive dependencies for you. This page has detailed information on how to specify dependencies. At the end is a list of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found