You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just recently added a logger into my service fabric application to log all service fabric communication. Because of this, it is dependent on ServiceContext. When I register my type that is dependent (on something that is dependent on something) on ServiceContext as a SingleInstance, when the Service resolve's said type I get "The requested service 'System.Fabric.ServiceContext' has not been registered".
If i remove "SingleInstance()" from the registration, everything works business as usual. Now, making my service not a singleton, isn't the worst thing in the world, but i would love for it to function as a Singleton.
I've tried injecting it as a "Lazy", and a Func<Lazy>, and all result in the same error. Any ideas?
Autofac.ServiceFabric 2.2.0
ServiceFabric 3.4.641
Stack trace:
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable1 parameters)
at Fake.ApplicationInsights.Autofac.RegistrationExtension.<>c__DisplayClass1_01.<RegisterFakeApplicationInsights>b__1(IComponentContext c) in C:\Users\matth\Documents\Fake Code\FakeShared\Fake.ApplicationInsights\Source\Fake.ApplicationInsights\Autofac\RegistrationExtension.cs:line 59 at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_01.b__0(IComponentContext c, IEnumerable1 p) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I just recently added a logger into my service fabric application to log all service fabric communication. Because of this, it is dependent on ServiceContext. When I register my type that is dependent (on something that is dependent on something) on ServiceContext as a SingleInstance, when the Service resolve's said type I get "The requested service 'System.Fabric.ServiceContext' has not been registered".
If i remove "SingleInstance()" from the registration, everything works business as usual. Now, making my service not a singleton, isn't the worst thing in the world, but i would love for it to function as a Singleton.
I've tried injecting it as a "Lazy", and a Func<Lazy>, and all result in the same error. Any ideas?
Autofac.ServiceFabric 2.2.0
ServiceFabric 3.4.641
Stack trace:
at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters) at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable
1 parameters)at Fake.ApplicationInsights.Autofac.RegistrationExtension.<>c__DisplayClass1_0
1.<RegisterFakeApplicationInsights>b__1(IComponentContext c) in C:\Users\matth\Documents\Fake Code\FakeShared\Fake.ApplicationInsights\Source\Fake.ApplicationInsights\Autofac\RegistrationExtension.cs:line 59 at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_0
1.b__0(IComponentContext c, IEnumerable1 p) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable
1 parameters)at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
Thanks!
The text was updated successfully, but these errors were encountered: