Repository navigation
Releases
v5.0.0
Breaking Changes
The constructor exception callback now receives the service lifetime scope
RegisterServiceFabricSupport's constructorExceptionCallback parameter changed from Action<Exception> to Action<ILifetimeScope, Exception>, so the callback can resolve dependencies — a logger, for example — from the lifetime scope created for the service that failed to construct. The scope is now disposed after the callback runs rather than before, which is what makes it usable. (#47)
// Before
builder.RegisterServiceFabricSupport(ex => Log(ex));
// After
builder.RegisterServiceFabricSupport((scope, ex) =>
scope.Resolve<ILogger>().LogError(ex, "Failed to construct service."));
// If you don't need the scope, discard it
builder.RegisterServiceFabricSupport((_, ex) => Log(ex));Minimum dependency versions raised
| Dependency | 4.0.0 | 5.0.0 |
|---|---|---|
| Autofac | 6.0.0 | 9.3.2 |
| Autofac.Extras.DynamicProxy | 6.0.0 | 8.1.0 |
| Microsoft.ServiceFabric.Services | 4.1.458 | 8.0.0 |
| Microsoft.ServiceFabric.Actors | 4.1.458 | 8.0.0 |
Service Fabric SDK 8.0.0 requires a cluster runtime of 11.0 or later. The Autofac reference spans three major versions; see the Autofac release notes for what changed there.
Other Changes
-
Optional constructor arguments on services and actors now resolve instead of failing with "None of the constructors found ... can be invoked with the available services and parameters." Every service and actor registration is class-intercepted, and the generated proxy constructor dropped the default values of the parameters it mirrored. Fixed in Autofac.Extras.DynamicProxy 8.1.0. (#41)
-
The assembly no longer declares an x64 platform target. It is pure IL, and marking it x64 meant it could not be loaded in an arm64 process at all. Consumers on Apple Silicon or other ARM hosts can now build and unit test against this package.
-
Service Fabric references are floored at the oldest supported SDK rather than tracking the newest. Your own Service Fabric version now wins, so upgrading Service Fabric no longer waits on a new release of this package, and consumers on an SDK older than the one this package was built against no longer get
NU1605package downgrade errors. Reference theMicrosoft.ServiceFabric.*packages you use explicitly and keep them consistent with each other — if you don't reference them at all, you'll silently get the 8.0.0 minimums. -
Microsoft.ServiceFabricandMicrosoft.ServiceFabric.Dataare no longer direct dependencies. They continue to arrive transitively throughMicrosoft.ServiceFabric.Services. -
The public API is annotated for nullable reference types. Projects with nullable reference types enabled may see new warnings where nullability was previously unexpressed.
-
Retained support for
netstandard2.0andnetstandard2.1; no target frameworks were added or removed. -
Expanded Service Fabric documentation covering the
InternalsVisibleTorequirement for internal service types, why components depending onServiceContextcannot beSingleInstance, theconfigurationActionhook for registering into the per-service scope, and Service Fabric package version alignment.
v4.0.0
This release is an update for compatibility with Autofac 6.0.0 and requires that new version. Autofac 6.0.0 does have some breaking changes - see the Autofac release notes for more information.
- Fix #57 - Provide hook to add registrations when lifetime scope for service is being created
v3.0.0
This release is an update for compatibility with Autofac 5.0.0 and requires that new version. Autofac 5.0.0 does have some breaking changes - see the Autofac release notes for more information.
- Minimum .NET Framework updated to .NET 4.6.1.
- Minimum Autofac 5.1.0.
Thanks @pcherpitel for the PR to get this done!
v2.2.0
v2.1.0
- Allow logging exceptions during service instantiation.
- Custom
ActorServicecan be passed toRegisterActor. - Lifetime scope tag for actors and services can now be specified during registration.
- Upgraded
Autofac.Extras.DynamicProxyto 4.5.0. - Switched from symbol server to SourceLink support.
- Upgraded Service Fabric packages to 6.3.187.
v2.0.0
v1.0.0
v1.0.0-beta1
v1.0.0-alpha3
- Removed non-generic registration methods.
- Allow internal service types to be registered if internals are visible to DynamicProxyGenAssembly2.
v1.0.0-alpha2
- Upgraded to Autofac 4.5.0 release package.
- Removed the need to call separate factory registration methods with IContainer instance after container built.
- Removed support for scanning based registration of Service Fabric services.