Unity - running Windows Service(s)

Jul 7, 2008 at 11:13 PM
 The following template is provided when creating a new Windows Service

static void Main()
[] ServicesToRun;
    ServicesToRun =
new ServiceBase[]
        new DataGatewayService(new GatewayService())

For now I'm going with the following code to launch my Windows Service (second service won't be required for a wee bit) but being new to Unity I'm not sure what the best way is to get an Array of ServiceBase[] to resolve....   In my ignorance I would opt to manually populate a Servicebase[] by iterating through the results of a ResolveAll(<ServiceBase>()) and passing it on to ServiceBase.Run().  

void Main()
    IUnityContainer container = new UnityContainer()
ServiceBase, Service1>()
ILogger, TraceLogger>()
IImageProcessor, ImageProcessorService>();


Is there a better way?