Built something? We create video reels & spotlights for GitHub projects.Promote your project →
Catalog / prabhakarpandey / Not-able-to-install-window-service-by-using-TopShelf
Public GitHub Catalog Discovered Sep 26, 2026

prabhakarpandey / Not-able-to-install-window-service-by-using-TopShelf

I am creating a window service by using console application.Below is my code:

View repository on GitHub ↗ View creator profile Browse directory

About this discovery

Public repository record indexed from GitHub. Explore verified star velocity metrics, source code repositories, and curated developer tool directories across the GitHubRepo ecosystem.

#6371620GitHub System ID
prabhakarpandeyOrganization / User
PublicVisibility
ActiveCatalog Status

More from prabhakarpandey

↗

prabhakarpandey/Not-ablle-to-install-window-service-by-using-TopShelf

I am creating a window service by using console application.Below is my code: namespace ConsoleApplication1 { //public class topshelf //{ // readonly Timer _timer; // public topshelf() // { // _timer = new Timer(10) { AutoReset = true}; // _timer.Elapsed += (sender, eventArgs) => Console.WriteLine("It is {0} an all is well", DateTime.Now); // } // public void Start() { _timer.Start(); } // public void Stop() { _timer.Stop(); } //} public class MyService : IService { public void Start() { Console.WriteLine("Running..."); } public void Stop() { Console.WriteLine("Done!"); } } public class Program { public static void Main(string[] args) { HostFactory.Run(x => //1 { x.Service<MyService>(s => //2 { s.ConstructUsing(name => new MyService()); //3 s.WhenStarted(tc => tc.Start()); //4 s.WhenStopped(tc => tc.Stop()); //5 }); x.RunAsLocalSystem(); //6 x.SetDescription("Sample Topshelf Host"); //7 x.SetDisplayName("MyService"); //8 x.SetServiceName("MyService"); //9 }); } } } PM> MySrvice.exe install gives error The term 'MyService.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling o f the name, or if a path was included, verify that the path is correct and try again. At line:1 char:14 + MyService.exe <<<< install + CategoryInfo : ObjectNotFound: (MyService.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Discovered
FOR MAINTAINERS

Built something? Put it in front of millions of developers.

We make a short reel about your project and post it across YouTube, Instagram, Threads, and X. Send a link, we do the rest.

SPONSORED Sponsored Partner