/// <summary>
        /// Runs the application in Console mode.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        static async Task RunConsole(string[] args)
        {
            var builder = new ContainerBuilder();

            builder.RegisterAllAssemblyModules();

            var binding = new BindingData("http", "*:4521:");
            await AppHostUtil.BuildHost(new[] { binding }, "/").RunAsync();

#if DEBUG
            Console.ReadLine();
#endif
        }
 protected override IEnumerable <ServiceInstanceListener> CreateServiceInstanceListeners()
 {
     yield return(new ServiceInstanceListener(ctx =>
                                              new AppHostCommunicationListener(ctx, "ServiceEndpoint", (bindings, path, _) =>
                                                                               AppHostUtil.BuildHost(bindings, path))));
 }