I would like to pass values into the constructor on the class that implements my service.
However ServiceHost only lets me pass in the name of the type to create,
I use static variables of my type. Not sure if this is the best way, but it works for me:
public class MyServer
{
public static string CustomerDisplayName;
...
}
When I instantiate service host I do the following:
protected override void OnStart(string[] args)
{
MyServer.CustomerDisplayName = "Test customer";
...
selfHost = new ServiceHost(typeof(MyServer), baseAddress);
....
}