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.

336 questions
6
votes
0 answers

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
  • 781
  • 12
  • 33
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
  • 694
  • 1
  • 11
  • 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,284
  • 5
  • 40
  • 63
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,152
  • 3
  • 29
  • 43
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…
jackie
  • 1,551
  • 3
  • 19
  • 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
  • 4,781
  • 6
  • 25
  • 33
5
votes
2 answers

Topshelf vs .net core worker service

How does Topshelf differ from a ASP.NET Core Worker Service? and what are the pros and cons of each of them and are they both support Windows and Linux?
5
votes
2 answers

Topshelf - Type or namespace name Topshelf cannot be found

I am attempting to play with Topshelf to host a Console application as a Windows Service, but I am running into problems... I have referenced the Topshelf dll, along with the log4net dll from my Console application. However, when I compile - either…
grefly
  • 1,151
  • 2
  • 11
  • 28
5
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,565
  • 4
  • 21
  • 44
5
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
  • 3,953
  • 2
  • 33
  • 46
5
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 …
DmitryBoyko
  • 32,983
  • 69
  • 281
  • 458
5
votes
0 answers

Topshelf service and Wix Installer

We develop a pack of windows services and used topshelf, which helped us to write them with easy. But now we implement an installer for them and faced a problem: Wix installs our services incorrectly. As mentioned here, the problem is because…
Alex Voskresenskiy
  • 1,894
  • 2
  • 15
  • 28
5
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,075
  • 1
  • 11
  • 20
1 2
3
22 23