Created
June 19, 2013 11:49
-
-
Save mizanRahman/5813685 to your computer and use it in GitHub Desktop.
snippet to run windows service from console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static void Main() | |
| { | |
| senTTRFservice service = new senTTRFservice(); | |
| if (Environment.UserInteractive) | |
| { | |
| service.OnStart(new string[]{""}); | |
| Console.WriteLine("Service Started. at {0}", DateTime.UtcNow); | |
| Console.Read(); | |
| service.OnStop(); | |
| } | |
| else | |
| { | |
| ServiceBase.Run(service); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment