3

Just wondering, would it be possible to start a windows service off a .net 3.5 dll and not an exe ?

Is there any workaround which helps one do that ?

How can one specify an entry point in that case ?

Thanks,

KG

4
  • 1
    I think your question "How can one specify an entry point in that case?" pretty much sums it up here :) Aug 24, 2012 at 21:54
  • :)..I heard about svchost.exe which could help one do this but I am not sure how reliable it is for usage in a production environment. Aug 24, 2012 at 22:08
  • Perhaps a Windows Service expert will provide an answer to this question, I'm curious myself. I've always used an EXE. Aug 24, 2012 at 22:13
  • Hmm..Just read hosting services on svchost is a hard thing to figure out. Aug 24, 2012 at 22:58

1 Answer 1

6

There is no "oficial way" to run a .net dll as a windows service. It would require the svchost.exe to load the DLL and bind to the start/stop exports. However there MS do not provides documentation on such topic.

In msdn documentation the terms used are "service application" or "service executable", so no "dll way" either.

EDIT:

Just found this attempt to run a dll as a service (pain!): http://forum.sysinternals.com/topic11974.html

2
  • Thanks for the reply. I had some issues downloading the service exes into the host due to antivirus blocking it. It looks like a dead-end since it blocks any exe download and dlls seem to get through. Aug 27, 2012 at 19:34
  • I see, if you have control over the download process, maybe you could download the exe via http an encrypted string stream to by pass the AV (although the AV still could block the installation). A msi setup could be an option too... Aug 27, 2012 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.