All Projects → rebus-org → Topper

rebus-org / Topper

Licence: other
🎩 Simple Windows Service helper (Topshelf-based, Azure Web Job capable)

Programming Languages

C#
18002 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to Topper

TopshelfDemoService
A daemon service demonstration application with Topshelf. 这是一个基于C#/.NET+Topshelf 实现的Windows服务程序。
Stars: ✭ 33 (+17.86%)
Mutual labels:  windows-service, topshelf
TopshelfHosting
Runs a .net core generic host as a Topshelf service.
Stars: ✭ 22 (-21.43%)
Mutual labels:  topshelf, windows-services
Flutter client php backend
Sample app demonstrating usage of Flutter Framework to Create Android & IOS App Using Rest API Created In PHP
Stars: ✭ 148 (+428.57%)
Mutual labels:  hosting
redis-topshelf
Wrap redis server console as windows service by topshelf
Stars: ✭ 11 (-60.71%)
Mutual labels:  topshelf
Awesome Openbsd
A curated list of awesome OpenBSD resources
Stars: ✭ 228 (+714.29%)
Mutual labels:  hosting
Awesome Static Hosting And Cms
A collection of awesome static hosting & CMS providers
Stars: ✭ 163 (+482.14%)
Mutual labels:  hosting
Awesome Selfhosted
A list of Free Software network services and web applications which can be hosted on your own servers
Stars: ✭ 70,996 (+253457.14%)
Mutual labels:  hosting
Server Monitor App
A PHP application to monitor the health of your servers
Stars: ✭ 141 (+403.57%)
Mutual labels:  hosting
ansible-role-gogs
DEPRECATED Ansible Role - Gogs: Go Git Service
Stars: ✭ 27 (-3.57%)
Mutual labels:  hosting
Awesome Mesh
This is a list for mesh networking: Documentation, Free Software mesh protocols, and applications. A mesh network is a network topology in which each node relays data for the network. All mesh nodes cooperate in the distribution of data in the network.
Stars: ✭ 227 (+710.71%)
Mutual labels:  hosting
Leap
Free & Open alternative to WHMCS. Let's see if we can make it
Stars: ✭ 270 (+864.29%)
Mutual labels:  hosting
Heroku Python Script
Guide for hosting python scripts and applications on Heroku
Stars: ✭ 218 (+678.57%)
Mutual labels:  hosting
Heroku Telegram Bot
Starter pack to host your Python Telegram Bot on Heroku for free.
Stars: ✭ 183 (+553.57%)
Mutual labels:  hosting
htmlhost
hostHTML.live is downright the fastest way of hosting your single page HTML!
Stars: ✭ 21 (-25%)
Mutual labels:  hosting
Meli
Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Stars: ✭ 2,125 (+7489.29%)
Mutual labels:  hosting
OrionServer
An open-source, centralized HTTPS botnet
Stars: ✭ 58 (+107.14%)
Mutual labels:  hosting
Modoboa
Mail hosting made simple
Stars: ✭ 1,998 (+7035.71%)
Mutual labels:  hosting
Javascript Interview Questions
500+ JavaScript Interview Questions
Stars: ✭ 208 (+642.86%)
Mutual labels:  hosting
Lab
The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
Stars: ✭ 231 (+725%)
Mutual labels:  hosting
ghostfire
We use this docker image to host Ghost websites at FirePress 🔥📰. See live demos at play-with-ghost.com
Stars: ✭ 20 (-28.57%)
Mutual labels:  hosting

Topper

install from nuget

Generic Windows service host - makes an ordinary Console Application hostable in the following scenarios:

  • To be F5-debugged locally - on your developer machine
  • To be installed as a Windows Service - on the servers in your basement
  • To be executed as an Azure Web Job - in the cloud!!

Based on Topshelf. Exposes a drastically simplified API, where "services" are simply factories that return something IDisposable.

Targets .NET Standard 2.0, so you must target either netcoreapp2.0 (or later), or net462 (or later) in your Console Application.

Getting started

Create YourNewAwesomeWindowsService as a Console Application project targeting AT LEAST .NET 4.6.2 or .NET Core App 2.0.

Include the NuGet package 📦

Install-Package Topper -ProjectName YourNewAwesomeWindowsService

and clean up your Program.cs so it becomes nice like this: 🌻

namespace YourNewAwesomeWindowsService
{
    class Program
    {
        static void Main()
        {
                
        }
    }
}

and then you configure Topper by going

var configuration = new ServiceConfiguration()
	.Add(.. function that returns an IDisposable ..)
	.Add(.. another function that returns an IDisposable ..);

ServiceHost.Run(configuration);

in Main, which could look like this:

namespace YourNewAwesomeWindowsService
{
    class Program
    {
        static void Main()
        {
            var configuration = new ServiceConfiguration()
                .Add(() => new MyNewAwesomeService());

            ServiceHost.Run(configuration);                
        }
    }
}

🐵 Easy!

Topper uses LibLog to log things. If you want to use Serilog, you probably want to

Install-Package Serilog.Sinks.ColoredConsole -ProjectName YourNewAwesomeWindowsService

and configure the global 🌍 logger before starting your service:

namespace YourNewAwesomeWindowsService
{
    class Program
    {
        static void Main()
        {
            Log.Logger = new LoggerConfiguration()
                .WriteTo.ColoredConsole()
                .CreateLogger();

            var configuration = new ServiceConfiguration()
                .Add(() => new MyNewAwesomeService());

            ServiceHost.Run(configuration);                
        }
    }
}

And that is how you use Topper.

How to run locally?

Press F5 or CTRL+F5 in Visual Studio.

Run the .exe

How to run as Windows Service?

Open an elevated command prompt, and run the .exe with the install argument, like so:

C:\apps\YourApp> YourApp.exe install

and then some Windows Service Control 🚥 stuff will appear and tell you some details on how it was installed.

You can remove it again like this:

C:\apps\YourApp> YourApp.exe uninstall

Not exactly surprising. 👏

How to run as Azure Web Job?

Just run it as you would any other Console Application as a Continuous Web Job.

Topper automatically monitors for the presence of the WEBJOBS_SHUTDOWN_FILE, to be able to shut down gracefully and dispose your IDisposables. ♻️


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].