private static void Run(TypeContainer tc) { Dictionary <string, object> settings = new Dictionary <string, object>(); settings["IotHubConfigFile"] = "IotHubConfig.json"; settings["OpcServerConfigFile"] = "OpcServerConfig.json"; settings["OpcTagConfigFile"] = "TagConfig.json"; //Configure TelemetryHost IServiceHost telemetryHost = tc.GetInstance <IServiceHost>(TELEMETRY_NAMESPACE); //until we have constructor support in TypeContainer, we will need to initialize the namespace separately telemetryHost.SetContainerNamespace(TELEMETRY_NAMESPACE); IProcessor telemetryHostProcessor = (IProcessor)telemetryHost; telemetryHostProcessor.Initialize(settings); //Configure ControlHost IServiceHost commandHost = tc.GetInstance <IServiceHost>(COMMAND_NAMESPACE); commandHost.SetContainerNamespace(COMMAND_NAMESPACE); IProcessor commandHostProcessor = (IProcessor)commandHost; commandHostProcessor.Initialize(settings); System.Console.WriteLine("Press ENTER to Start IoT Gateway"); System.Console.ReadLine(); telemetryHost.Start(); commandHost.Start(); //wait for the user to exit System.Console.WriteLine("Press ENTER to exit"); System.Console.ReadLine(); }