Topshelf is a framework for hosting services written using the .NET framework. The creation of services is simplified, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service.
Apache 2.0 - see LICENSE
Get started in four simple steps!
- Step 1 (get the bits):
-
The easiest way to get Topshelf in your project is to use NuGet.
If you aren't using NuGet, you can always download the code.
- Clone
- Branch
git submodule init
git submodule update
- Make changes
- Push
- Make a pull request
- Clone the source down to your machine.
git clone --recursive git://github.com/Topshelf/Topshelf.git
- Download git, ruby and gems. Install – a tutorial is here
- gem install rake albacore semver2
- Important: Run
rake global_version
in order to generate the SolutionVersion.cs file which is otherwise missing.- You must have git on the path in order to do this. (Right click on
Computer
>Advanced System Settings
,Advanced
(tab) >Environment Variables...
> Append the git executable's directory at the end of the PATH environment variable.
- You must have git on the path in order to do this. (Right click on
- Edit with Visual Studio 2010 or alternatively edit and run
rake
.rake help
displays all possible tasks that you can run. Thepackage
task, is what the build server does. - The default is .Net 4.0. At the moment, editing the solution file for .Net 3.5 requires the "fix" below.
- Run
rake global_version
in the root folder. - Set Visual Studio Tools -> Options -> Text Editor -> All Languages -> Tabs to use "Tab Size" = 4, "Indent Size" = 4, and "Insert Spaces"
- Double-click/open the .sln file.
You can alternatively edit and build for .Net 3.5 instead of .Net 4.0 with this step:
-
Edit all
Topshelf/src/**/*.csproj
files at the top of the files, where it says:<TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v4.0</TargetFrameworkVersion>
Change
v4.0
tov3.5
. The build script itself won't be affected by this change, but it'll help Visual Studio know what version we're building for.
- Edit Topshelf.Host/app.config and uncomment the supportedRuntime- and runtime-elements.
- Getting an overview:
rake help
- Getting descriptions of the tasks:
rake -P
- Read some articles; currently we need help with environments configuration and reducing the noise in tasks by making the files FileTask-s themselves. Some of this stuff is discussed here.
In general you should define your tasks to have the least number of dependencies to function. Paths should be placed in the props dictionary at the start of the rake file.
To run the build, rake, .NET 3.5, and .NET 4.0 are required. To open the solution, you must have Visual Studio 2010 Service Pack 1.
Logo Design by The Agile Badger Copyright 2007-2013 Travis Smith, Chris Patterson, Dru Sellers, Henrik Feldt et al. All rights reserved