C
Chizl
I created a console app, but most all the code was in classes. I've
recently created a windows service, pulled all the classes over and
everything compiles fine.
Few things I need to understand though. I'm a C++ guy so this service is
much different to me.
1) Where do I spawn the main thread off from?
(a) My first guess is in the Program.cs in the Main() before the
ServiceBase.Run(). However, that doesn't seem right because if I'm only
registering it, then I don't want my service to start processing only
register.
(b) My second guess would be after the ServiceBase.Run(), However
that should stop within Run and never get my thread started.
2) How do I register this service under Windows Services?
(a) In C++ it was just "ExeName.exe /Service". After digging
around I found some Mono code that represents what C# does and it was using
/Install. However it doesn't seem to work, instead I get errors saying I
need to run InstallUtil.exe. I looked at InstallUtil.exe and ran it
against my exe it seems to run successfully, but out side of created 2 more
files, it didn't seem to do anything.
(b) Once I get it install I'll need to know how to remove it from
services, like /UnRegservice does in C++.
3) How to add an icon to my service?
(a) I created a resource file with an icon, but it seems to be
ignoring the icon.
recently created a windows service, pulled all the classes over and
everything compiles fine.
Few things I need to understand though. I'm a C++ guy so this service is
much different to me.
1) Where do I spawn the main thread off from?
(a) My first guess is in the Program.cs in the Main() before the
ServiceBase.Run(). However, that doesn't seem right because if I'm only
registering it, then I don't want my service to start processing only
register.
(b) My second guess would be after the ServiceBase.Run(), However
that should stop within Run and never get my thread started.
2) How do I register this service under Windows Services?
(a) In C++ it was just "ExeName.exe /Service". After digging
around I found some Mono code that represents what C# does and it was using
/Install. However it doesn't seem to work, instead I get errors saying I
need to run InstallUtil.exe. I looked at InstallUtil.exe and ran it
against my exe it seems to run successfully, but out side of created 2 more
files, it didn't seem to do anything.
(b) Once I get it install I'll need to know how to remove it from
services, like /UnRegservice does in C++.
3) How to add an icon to my service?
(a) I created a resource file with an icon, but it seems to be
ignoring the icon.