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

Missing dependency on System.Reactive.Linq? #19

Closed
OlduwanSteve opened this issue Jul 31, 2017 · 8 comments
Closed

Missing dependency on System.Reactive.Linq? #19

OlduwanSteve opened this issue Jul 31, 2017 · 8 comments

Comments

@OlduwanSteve
Copy link

Hi, I've created a console project in VS 2017 and added the echo.process 2.0.27-beta nuget package. The code below throws:

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Reactive.Linq, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' 

because it cannot load the assembly System.Reactive.Linq

using Echo;
using System.Data;
using static Echo.Process;

namespace ep_datatable_bug
{
    class Program
    {
        static void Main(string[] args)
        {
            ProcessConfig.initialise();
        }
    }
}

@OlduwanSteve
Copy link
Author

Same problem for System.Reactive.PlatformServices

@louthy
Copy link
Owner

louthy commented Jul 31, 2017

@OlduwanSteve Yes, this is an ongoing thorn in my side that I'm not sure how to fix. All of the projects refer to System.Reactive 3.1.1 (as does language-ext), yet for some reason it's trying to refer to an older version.

Anyway in the short term you will need to use assembly bindings, these are working for me atm:

<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Reactive.Interfaces" publicKeyToken="94bc3704cddfc263" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.1000.0" newVersion="3.0.1000.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Reactive.Linq" publicKeyToken="94bc3704cddfc263" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="System.Reactive.PlatformServices" publicKeyToken="94bc3704cddfc263" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
          </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

@TysonMN
Copy link

TysonMN commented Dec 29, 2017

I was able to reproduce the problem just as OP described it.

I found a different workaround. Maybe this will help to find a (better) solution to this problem.

When I finished reproducing problem as described by OP, the version of the System.Reactive NuGet package was 4.0.0-preview00001. I think this is its latest prerelease. I think a prerelease was installed because I had to allow preleases in order to install Echo-Process (only available version is version 2.0.23-beta). I manually downgraded to the latest released version of System.Reactive, which is 3.1.1. Recall that the Echo-Process dependency on System.Reactive has version constraint (>= 3.1.1). After this downgrade, running the console app didn't throw any exception (it just opened and closed shortly after).

It seems to me that you could fix this problem by changing the Echo-Process dependency on System.Reactive to have version constraint (= 3.1.1). Another idea is to keep the >= relation but somehow restrict to released versions (i.e. forbid prerelease versions). I don't know how to do that though.

@StefanBertels
Copy link
Contributor

Hi, I had another RX-related issue with same error message and could solve it. I add this as a comment here if others search for help...

My setup: I use System.Reactive 4.0.0 (which is current stable) and Echo.Process (current 2.0.41-beta) in my project. Echo.Process references to old System.Reactive.Linq (i.e. Reactive 3.x).

Solution: I added
<PackageReference Include="System.Reactive.Compatibility" Version="4.0.0" />
to my csproj and got rid of the error.

This is due to a change made by the RX team (moving to a single System.Reactive.dll) in v4. Details see here: https://github.com/dotnet/reactive#v40-changes

Maybe @louthy could update Echo.Process eventually to System.Reactive 4.0.0...

@louthy
Copy link
Owner

louthy commented Aug 25, 2018

These issues should all now be resolved now we're on System.Reactive 4.*

@louthy louthy closed this as completed Aug 25, 2018
@EmilAlipiev
Copy link

problem still exist on 4.*

@EmilAlipiev
Copy link

@StefanBertels i have similar problem on a xamarin forms project. one of the package referencing 4.0 and another one 3.0 I tried to follow your solution but i get even more conflicts and errors. it doesnt allow me to nstall compability package. you can see the topic here and i uploaded a very tiny repro project.

xamarin/mqtt#161

@louthy
Copy link
Owner

louthy commented Oct 9, 2018

@EmilAlipiev I haven't seen this issue on 4. I would make sure you don't have some projects with an old version of echo, or some projects with an old version of Rx. If other libraries refer to an old Rx then you will need to create an assemblyBinding so they all use the same version.

Your example project doesn't appear to refer to echo at all.

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

5 participants