running service from command line
running service from command line
(OP)
Hello,
I have a service programmed in VS that compiles as a dll. To run the service, I need to open VS and run it. Is there a way to run my dll from the command line (i.e. without having to open VS)?
I have a service programmed in VS that compiles as a dll. To run the service, I need to open VS and run it. Is there a way to run my dll from the command line (i.e. without having to open VS)?
RE: running service from command line
You need to build a console app to actually execute your code.
You've got questions and source code. We want both!
Here at tek tips, we provide a hand up, not a hand out.
RE: running service from command line
http://social.msdn.microsoft.com/Forums/en-US/netf...
Scroll to the bottom to see one developers take.
RE: running service from command line
I've recently learnt how to use
System.Diagnostics.Process.Start(pathToExe)
This works on exe's of course, not dlls, but I'm thinking there must be a similar way to run dlls. I know VS does it (when I hit F5) so why can't it be done from a command line. If I can figure that out, maybe I can take that command and pass it into
System.Diagnostics.Process.Start(command)
It will probably require a bit of tweeking since it's not exactly an executable (not necessarily) but I'm sure there must be a way to do it along these lines.
Thanks for the link. They seem to be talking about something that requires you to "install" the service (into Window's registry, I presume). I looked up installing services the other day and came across this utility:
regsvr32
From what I read, if you put your dll in Windows/System32 and cd to that directory, then type "regsvr32 yourservice.dll", it should install it.
But when I try it, it tells me
Now, I don't mind modifying the source code to give it the entry-point DllRegisterServer (is that like Main?) but I'd rather not modify anything since it's not really my code (it belongs to the company and is under version control), so I'd prefer to use some alternate way of accomplishing my goal (if there is one). If there is no alternative, just let me know and I'll persue making it insatllable by this means. Thanks.
RE: running service from command line
http://www.codeproject.com/Articles/14353/Creating...
(don't worry, it's about Csharp, not C;)...