Skip to content

Service Fabric NuGet package references use exact version matching #138

Open
@alexmg

Description

@alexmg

The Service Fabric NuGet packages such as Microsoft.ServiceFabric.Actors and Microsoft.ServiceFabric.Services are pinned to exact versions which is causing some headaches for consumers of the Autofac.ServiceFabric package as can be seen in issue autofac/Autofac.ServiceFabric/issues/18.

Autofac.ServiceFabric contains references to the following packages:

  • Microsoft.ServiceFabric
  • Microsoft.ServiceFabric.Actors
  • Microsoft.ServiceFabric.Data
  • Microsoft.ServiceFabric.Services

Due to the exact versions being specified in your packages the NU1608 warning and NU1107 error occur when attempting to upgrade a Service Fabric project to a version newer than the one the Autofac.ServiceFabric package was built against.

warning NU1608: Detected package version outside of dependency constraint: Microsoft.ServiceFabric.Services.Remoting 3.0.456 requires Microsoft.ServiceFabric.Services (= 3.0.456) but version Microsoft.ServiceFabric.Services 3.2.162 was resolved.
warning NU1608: Detected package version outside of dependency constraint: Microsoft.ServiceFabric.FabricTransport.Internal 3.0.456 requires Microsoft.ServiceFabric (= 6.1.456) but version Microsoft.ServiceFabric 6.3.162 was resolved.
error NU1107: Version conflict detected for Microsoft.ServiceFabric.Diagnostics.Internal. Reference the package directly from the project to resolve this issue. 
error NU1107:  Stateless1 -> Microsoft.ServiceFabric.Services 3.2.162 -> Microsoft.ServiceFabric.Diagnostics.Internal (= 3.2.162) 
error NU1107:  Stateless1 -> Autofac.ServiceFabric 2.0.0 -> Microsoft.ServiceFabric.Actors 3.0.456 -> Microsoft.ServiceFabric.Diagnostics.Internal (= 3.0.456).

It doesn't matter if a version range such as [3.1.274,4.0) is specified in the package references in Autofac.ServiceFabric. The only way to resolve the issue is to add all the packages to the Service Fabric project. For example, in a stateless service project you still need to add the Microsoft.ServiceFabric.Actors package even though it isn't required directly.

Is it possible to remove the exact version match in the Service Fabric packages? It seems like it was a conscious decision to pin the versions so I suspect there is likely a good reason for it. If the need no longer exists or could be worked around it would make working with your NuGet packages much easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions