0

I am having trouble in finalizing my window service.As my logic works fine in console application.But the problem is:

How to add installer and installutil.exe in the project?

1 Answers1

2

Go to Visual Studio Command prompt, and type installutil.exe <path to exe>

Alternatively, installutil.exe is located under C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe

Note: Depending on your framework version, path to installutil.exe will change

Refer to this SO thread which has already an answer Install a Windows service using a Windows command prompt?

Are you having trouble while adding installer in your project? Any detailed information will help us in guiding you in the right direction

  • When i install my *window service* it doesn't works and also not showing the service in **services.msc** – Malik Usman Nawaz Nov 14 '17 at 07:07
  • BTW, what type of project are you using? Windows Service or Console Application, Refer to this article in csharp-corner having step by step details on creating a windows service. http://www.c-sharpcorner.com/UploadFile/b7531b/create-simple-window-service-and-setup-project-with-installa/ – Deepan Maheswaran Nov 14 '17 at 07:12
  • I am using **Windows Service** and tested my code in *Console Application*. – Malik Usman Nawaz Nov 14 '17 at 07:16
  • that works fine in console application but not **Windows Service** – Malik Usman Nawaz Nov 14 '17 at 07:17
  • Ensure your user account have appropriate permissions to install the service, can you try installing the service from administrator account? or do you face any error while installing the service? if so, post the error to troubleshoot further – Deepan Maheswaran Nov 14 '17 at 07:21
  • I have only one user account (_i.e Administrator_). On installation there is a admin privilege prompt. There is no error message. – Malik Usman Nawaz Nov 14 '17 at 07:27
  • Installation is all perfect. But the problem is: service is not performing it's task and also not showing in **services.msc**. – Malik Usman Nawaz Nov 14 '17 at 07:29
  • You can try writing a status to a log file in your windows service OnStart event to ensure the service is started. You can also check Windows EventViewer for any possible errors occurred while starting your service. – Deepan Maheswaran Nov 14 '17 at 07:59