Plugging code to a service

J

John

Hi

I am writing a vb.net windows service which is expected to have its
processing code changed more often than usual. As uninstalling and
reinstalling a service is bit awkward, is there a way for the service to
call code that residues outside the service that can be changed easily
without having to uninstall and reinstall service whenever the processing
requirements change? If so how?

Thanks

Regards
 
P

Phill W.

John said:
I am writing a vb.net windows service which is expected to have its
processing code changed more often than usual. As uninstalling and
reinstalling a service is bit awkward,

Yes, but why bother?

So long as you [can] /stop/ the service first, you scan simply overwrite
the executable and then restart it.
is there a way for the service to
call code that residues outside the service that can be changed easily
without having to uninstall and reinstall service whenever the processing
requirements change? If so how?

You're thinking along the lines of "plug-ins" here.
Yes, it's perfectly possible but your problem will be overwriting the
"plug-in" dll's after the service has [loaded and] used it.
You'll have to play with creating AppDomains within the service /into
which/ you load and run each "plug-in" then, when you tear down the
AppDomain, then (in theory) the dll should be freed up for you to
overwrite it.

HTH,
Phill W.
 
G

Guest

processing code changed more often than usual. As uninstalling and
reinstalling a service is bit awkward, is there a way for the service
to call code that residues outside the service that can be changed
easily without having to uninstall and reinstall service whenever the
processing requirements change? If so how?

Yes you can create a plugin framework.

You can use reflection to do this.
 
S

Steve Gerrard

John said:
Hi

I am writing a vb.net windows service which is expected to have its
processing code changed more often than usual. As uninstalling and
reinstalling a service is bit awkward, is there a way for the service
to call code that residues outside the service that can be changed
easily without having to uninstall and reinstall service whenever the
processing requirements change? If so how?

As Phil said, once you have installed the service, you just stop it using the
Services panel, replace the exe, and start it again. Its very quick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top