Questions tagged [topshelf]

Topshelf is a service hosting framework for building Windows services using .NET.

Topshelf is a cross-platform (Windows and Mono) service hosting framework for .NET. Provides a simple fluent API for service configuration.

Source code is available for download on github and documentation/examples are available on the Topshelf project site and Topshelf documentation.

352 questions
6
votes
5 answers

Windows Service cannot access network location (UNC) Path

I have a windows service that polls a folder continuously for new files.For local directories this works fine.But when it comes to UNC Paths on another system in the same network,the service cannot access the folder it seems.I have refereed to this…
techno
  • 6,100
  • 16
  • 86
  • 192
6
votes
0 answers

Topshelf - Service did not start in a timely manner

Im trying to create a windows service using topshelf.I have managed to successfully create what i want and debug it.I have also managed to install the service using myservice.exe install But upon attempting to launch the service using the service…
techno
  • 6,100
  • 16
  • 86
  • 192
6
votes
2 answers

Why is my Windows Service not logging until the service is restarted

tl;dr I've created a Windows Service using TopShelf, added logging using Log4Net, and then built the project, installed the service and started the service. Then my service runs fine, but it is not logging. The TopShelf logs appear, but not the logs…
Jamie Twells
  • 1,924
  • 4
  • 26
  • 56
6
votes
1 answer

Topshelf halts service recovery after third attempt

I am using Topshelf to create a Windows Service. This service will attempt recovery the first 3 failures, but after that, it no longer work. Inspecting the service in Services on the host reveals: First Failure: Restart the Service Second…
Troels Larsen
  • 4,462
  • 2
  • 34
  • 54
6
votes
1 answer

How to use Topshelf.Logging properly

Any clue how to use Topshelf.Logging properly? Do I have to pass NLogLogWriter to the constructor of the service class? And how to enable output to console as well? class Program { #region Properties …
NoWar
  • 36,338
  • 80
  • 323
  • 498
6
votes
2 answers

Topshelf: install command does not return after successfully installing the service

NOTE: I'm not doing anything similar to Topshelf installer requires me to press enter twice - why? Service class (interesting parts): public class ServiceCore { public ServiceCore(ServiceRuntimeConfiguration serviceRuntimeConfiguration) { …
Sudhanshu Mishra
  • 6,523
  • 2
  • 59
  • 76
6
votes
1 answer

Single command line parameter to control Topshelf windows service

I've made a topshelf windows service that starts three tasks. But since it might happen that one of those task might crash (yes, I know about EnableServiceRecovery), it would be better to use one program to create 3 services with different names …
Yasskier
  • 791
  • 1
  • 14
  • 36
6
votes
2 answers

TopShelf service stuck in 'Stopping' state on exception

I have a TopShelf (3.1.3) service that hangs in a 'Stopping' state when an exception is raised. As a result none of the service recovery steps get invoked, and uninstalling the service only succeeds if the service is manually killed via 'taskkill'.…
mindlessgoods
  • 1,135
  • 1
  • 11
  • 22
6
votes
1 answer

Executing multiple Quartz.NET jobs with Topshelf

I am attempting to run multiple jobs with Quartz.NET and Topshelf using C#. HostFactory.Run(c => { c.ScheduleQuartzJobAsService(q => q.WithJob(() => JobBuilder.Create().Build()) .AddTrigger(() =>…
Citrus
  • 756
  • 1
  • 13
  • 26
6
votes
1 answer

Get ServiceName/ Instance after calling TopShelf.HostFactory.Run

Is there a way to get the ServiceName and InstanceName given to a TopShelf service after a call to TopShelf.HostFactory.Run()? One option is to simply pull it directly from the command line args. But curious if it TopShelf exposes these properties…
Ryan Anderson
  • 937
  • 10
  • 23
6
votes
4 answers

Windows Service started and then stopped using Topshelf

I am using Quartz.net and I am trying to get the Quartz server to start-off in a Windows Service. I have created a Windows Service Project and included the Quartz.net libraries. In my Service class I have: protected override void OnStart(string[]…
Seany84
  • 5,526
  • 5
  • 42
  • 67
6
votes
2 answers

Integration Tests With Topshelf to Start a C# Windows Service

I'm using Topshelf to host a Windows Service written in C# and I now want to write some integration tests. My initialisation code is held in a launcher class like the following: public class Launcher { private Host host; ///
Adam Rodger
  • 3,472
  • 4
  • 33
  • 45
5
votes
2 answers

Topshelf multiple host

Is there any way in topshelf to run multiple host in one executable? // Create hosts var h1 = HostFactory.New (...); var h2 = HostFactory.New (...) // Start hosts in one application Runner.Run (h1, h2); Edit Solved with threads. But not sure if…
jack-london
  • 1,599
  • 3
  • 21
  • 42
5
votes
1 answer

Ninject scope problems with TopShelf, Ninject and EF code first

I am currently using TopShelf with Ninject to create a Windows Service. I have the following code to setup the Windows Service using TopShelf: static void Main(string[] args) { using (IKernel kernel = new StandardKernel(new…
5
votes
1 answer

Blank responses using Nancy self host + TopShelf

I am trying to use Nancy (using the Self Hosting with Razor views nuget packages) inside of a Topshelf service. I am hosting it on http://localhost:8585/, and it works just fine while I'm in debug mode or call my executable directly. The Nancy…
John Nelson
  • 5,041
  • 6
  • 27
  • 34
1 2
3
23 24