akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.69k stars 1.04k forks source link

Akka NuGet package references wrong System.Collections.Immutable version #2286

Closed dnauck closed 7 years ago

dnauck commented 8 years ago

Hello,

i added the "Akka" nuget package via Paket (@forki) to my project and Paket resolved the dependency System.Collections.Immutable to the version 1.1.36.

paket.lock:

    Akka (1.1.1)
      Newtonsoft.Json (>= 7.0.1)
      System.Collections.Immutable (>= 1.1.36)
    System.Collections.Immutable (1.1.37)
      System.Collections (>= 4.0) - framework: dnxcore50
      System.Diagnostics.Debug (>= 4.0) - framework: dnxcore50
      System.Globalization (>= 4.0) - framework: dnxcore50
      System.Linq (>= 4.0) - framework: dnxcore50
      System.Resources.ResourceManager (>= 4.0) - framework: dnxcore50
      System.Runtime (>= 4.0) - framework: dnxcore50
      System.Runtime.Extensions (>= 4.0) - framework: dnxcore50
      System.Threading (>= 4.0) - framework: dnxcore50

Pinning the System.Collections.Immutable to version 1.2.0 solved the problem.

System.IO.FileLoadException: Could not load file or assembly 'System.Collections.Immutable, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'System.Collections.Immutable, Version=1.1.36.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)\r\n --- End of inner exception stack trace ---\r\n at Akka.Event.EventStream..ctor(Boolean debug)\r\n at Akka.Actor.Internal.ActorSystemImpl.ConfigureEventStream()\r\n at Akka.Actor.Internal.ActorSystemImpl..ctor(String name, Config config)\r\n at Akka.Actor.ActorSystem.CreateAndStartSystem(String name, Config withFallback)\r\n at Akka.Actor.ActorSystem.Create(String name, Config config)\r\n

Looks like there're other problems with references in the Akka Nuget packages as in #2227

Aaronontheweb commented 8 years ago

We intentionally use this version of the package because Microsoft bumped the .NET Framework runtime they target in higher versions than 4.5. Why is this an issue (i.e. what depends on 1.2 - is that something in Akka.NET?)

ritcoder commented 8 years ago

Not exactly sure if it is reason but I've been trying to identify and fix the error below after deploying a Suave app using Akka.net and Akkling to Azure.

The error is

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException

Exception Info: System.IO.FileLoadException
   at Akka.Event.EventStream..ctor(Boolean)
   at Akka.Actor.Internal.ActorSystemImpl.ConfigureEventStream()
   at Akka.Actor.Internal.ActorSystemImpl..ctor(System.String, Akka.Configuration.Config)
   at Akkling.System.create(System.String, Akka.Configuration.Config)
   at Mmt.Ussd.Actors.setup(Mmt.Ussd.Settings)
   at Program.start(System.String)
   at Program.main(System.String[])

It was almost impossible identifying the file involved. However, the azure web app started working when I removed the assembly binding. I'm suspecting it has something to do with it since that appears to be the last change I made before the error disappeared.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.2.0.0" newVersion="1.2.0.0" />
  </dependentAssembly>
</assemblyBinding>
ZoolWay commented 7 years ago

Maybe the downgrad to 1.1.36 can be reconsidered. While 1.1.37 of System.Collections.Immutable targeted .NET5, versions 1.2 and 1.3 are targeting .NET 4.5 again. Compare with dependencies here: https://www.nuget.org/packages/System.Collections.Immutable/1.3.0

Maybe 1.1.37 was a mistake in the .NET core versioning jungle...

Danthar commented 7 years ago

Its certainly worth investigating

OlegZee commented 7 years ago

Observing the same issue on a project with the following paket.dependencies:

source https://www.nuget.org/api/v2/ framework >= net45

nuget Akka nuget akka.remote nuget Akka.TestKit nuget Google.ProtocolBuffers nuget nbench nuget NBench.Runner nuget Newtonsoft.Json nuget NUnit

ZoolWay commented 7 years ago

Gentle notification: Latest version of System.Collection.Immutable is now 1.3.1 from January 3rd. Also supporting .NET 4.5.

marcpiechura commented 7 years ago

Closed via #2509