2
Answers

Can I run a console app as a service on a computer?

Dev User

Dev User

7y
290
1
I recently built a C# console application and it is working fine when I execute the file.
However, the client requested that I run it as a service. Is that even possible without me recoding the entire application as a Windows Service app in c#? Another drawback is that I am not familiar with writing windows services if I convert it.
 
I have tried https://www.howtogeek.com/50786/using-srvstart-to-run-any-application-as-a-windows-service/ but when I start my service it errors out with 1067:  The process terminated unexpectedly.
 
I am really unsure what to do at this point. Is there other way that I can run my console app as a windows service without having to re-code everything?
 
Thanks,
-h 
Answers (2)
0
G Arun

G Arun

NA 84 560 7y
Find here https://docs.microsoft.com/en-us/uwp/win32-and-com/alternatives-to-windows-apis-uwp
0
Akhil Bhaskar

Akhil Bhaskar

NA 81 5.9k 7y
Arun Thanks For Your Reply 
 
 how can i find which API i am using for my sdk..
 
i am using visual studio 2017 
 
 
0
G Arun

G Arun

NA 84 560 7y
Hi akhil,
Error clearly states that the api which your using is not availble in sdk.Find alternative implementation of your api in exisiting sdk.you can check available apis in the following link
https://docs.microsoft.com/en-us/uwp/win32-and-com/alternatives-to-windows-apis-uwp
 
Hope this answer helps you.