Windows Vista Forums

Passing instance data via ServiceHost
  1. #1


    Chad Z. Hower Guest

    Passing instance data via ServiceHost

    I have a single class which is used from mutliple ServiceHost
    instances. I need this to simulate several environments on one machine.
    I need to somehow pass some information from the time I create the
    ServiceHost down to the contract class.

    1) I looked for a static method or other that would be accesible from
    the contract class, but did not find any.

    2) I can use singleton constructor and pass an instance of the class
    with the data. But the docs are very sparse and when it talks about
    singleton and based on the error I received, it appears not only
    singleton to serialize requests - I dont want that.



    3) I could make them separate processes or appdomains, but I would
    really prefer to avoid that for simplicity reasons as well as
    manageablility.

    --
    "Programming is an art form that fights back"
    http://www.KudzuWorld.com/
    Need a professoinal technical speaker at your event? See www.woo-hoo.net
      My System SpecsSystem Spec

  2. #2


    Chad Z. Hower Guest

    Re: Passing instance data via ServiceHost

    Chad Z. Hower wrote:
    > 3) I could make them separate processes or appdomains, but I would
    > really prefer to avoid that for simplicity reasons as well as
    > manageablility.


    FWIW I put them in AppDomains. This allows me to control instance data
    via statics in classes or the working directories.

    But input still welcome for curiosity sake.

    --
    "Programming is an art form that fights back"
    http://www.KudzuWorld.com/
    Need a professoinal technical speaker at your event? See www.woo-hoo.net
      My System SpecsSystem Spec

  3. #3


    Arkady Frenkel Guest

    Re: Passing instance data via ServiceHost

    Why can't you use static class with multiple services in the same process
    ( domain ) , just a hint
    Arkady

    "Chad Z. Hower" <chad-ng@hower.org> wrote in message
    news:OrYq7uy4GHA.1848@TK2MSFTNGP06.phx.gbl...
    > Chad Z. Hower wrote:
    >> 3) I could make them separate processes or appdomains, but I would
    >> really prefer to avoid that for simplicity reasons as well as
    >> manageablility.

    >
    > FWIW I put them in AppDomains. This allows me to control instance data
    > via statics in classes or the working directories.
    >
    > But input still welcome for curiosity sake.
    >
    > --
    > "Programming is an art form that fights back"
    > http://www.KudzuWorld.com/
    > Need a professoinal technical speaker at your event? See www.woo-hoo.net



      My System SpecsSystem Spec

Passing instance data via ServiceHost problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
ReportViewer: A data source instance has not been supplied for the data source Rupinder .NET General 0 08 Nov 2009
Generic Class: Passing Data Type to Placeholder Etienne-Louis Nicolet .NET General 4 08 Aug 2008
Not receiving Faulted event from ServiceHost Stephen Sankey Indigo 1 18 Sep 2007
ServiceHost in a Form ewolfman Indigo 8 28 Jun 2006
ServiceHost in System.ServiceModel Ed Indigo 1 26 Apr 2006