Skip to content

cant install as a service, works in VS #2

@mkornilu

Description

@mkornilu

I cant install this as windows service. When i install and start i have en error:

Topshelf.ServiceBuilderException: An exception occurred creating the service: ServiceHost ---> StructureMap.StructureMapConfigurationException: No default Instance is registered and cannot be automatically determined for type 'WillCorp.Logging.ILogger'

There is no configuration specified for WillCorp.Logging.ILogger

1.) new ServiceHost(Default of ILogger, Default of IEnumerable)
2.) WillCorp.HostService.ServiceHost
3.) Instance of WillCorp.HostService.ServiceHost
4.) Container.GetInstance<WillCorp.HostService.ServiceHost>()

w lambda_method(Closure , IBuildSession , IContext )
w StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context)
w StructureMap.BuildSession.BuildNewInSession(Type pluginType, Instance instance)
w StructureMap.Pipeline.NulloTransientCache.Get(Type pluginType, Instance instance, IBuildSession session)
w StructureMap.BuildSession.ResolveFromLifecycle(Type pluginType, Instance instance)
w StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle)
w StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph)
w StructureMap.Container.GetInstanceT
w Topshelf.StructureMap.StructureMapServiceConfiguratorExtensions.<>c__01.<GetFactory>b__0_0() w Topshelf.ServiceConfiguratorExtensions.<>c__DisplayClass0_01.b__0(HostSettings settings)
w Topshelf.Builders.DelegateServiceBuilder1.Build(HostSettings settings) --- Koniec śladu stosu wyjątków wewnętrznych --- w Topshelf.Builders.DelegateServiceBuilder1.Build(HostSettings settings)
w Topshelf.Builders.RunBuilder.Build(ServiceBuilder serviceBuilder)
w Topshelf.HostConfigurators.HostConfiguratorImpl.CreateHost()
ex.StackTrace
w Topshelf.Builders.DelegateServiceBuilder`1.Build(HostSettings settings)
w Topshelf.Builders.RunBuilder.Build(ServiceBuilder serviceBuilder)
w Topshelf.HostConfigurators.HostConfiguratorImpl.CreateHost()
ex.Message
An exception occurred creating the service: ServiceHost
ex.InnerException?.Message
No default Instance is registered and cannot be automatically determined for type 'WillCorp.Logging.ILogger'

There is no configuration specified for WillCorp.Logging.ILogger

1.) new ServiceHost(Default of ILogger, Default of IEnumerable)
2.) WillCorp.HostService.ServiceHost
3.) Instance of WillCorp.HostService.ServiceHost
4.) Container.GetInstance<WillCorp.HostService.ServiceHost>()

In VS 2022 it starts and works like a charm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions