Plugging code to a service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Plugging code to a service

    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


  • Phill W.

    #2
    Re: Plugging code to a service

    John wrote:
    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.

    Comment

    • Spam Catcher

      #3
      Re: Plugging code to a service

      "John" <John@nospam.in fovis.co.ukwrot e in
      news:#MhDTqfeIH A.3400@TK2MSFTN GP03.phx.gbl:
      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.

      --
      spamhoneypot@ro gers.com (Do not e-mail)

      Comment

      • Steve Gerrard

        #4
        Re: Plugging code to a service

        John wrote:
        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.


        Comment

        Working...