示例#1
0
        // Don't use this async-Main() method signature since it does not allow placing a breakpoint after all program execution. The Main() method returns the task immediately, leaving running the task up to the .NET runtime.
        //static Task Main(string[] args)
        //{
        //    return Program.HostedServiceProgramExampleAsync();
        //}

        //static void Main(string[] args)
        //{
        //    //Program.ServiceProviderExample();
        //    //Program.HostExample();
        //    //Program.WebHostExample();
        //    Program.HostedServiceProgramExample();
        //}

        private static Task HostedServiceProgramExampleAsync()
        {
            //var emptyServiceProvider = ServiceProviderHelper.GetEmptyServiceProvider();

            //await HostServiceBuilder.New()
            //    .UseStartup<Startup>()
            //    .UseHostedServiceProgram<Program04>()
            //    .Build(emptyServiceProvider)
            //    .RunAsync()
            //    ;

            var task = HostedServiceProgram.RunAsync <Program04, Startup>();

            return(task);
        }
示例#2
0
 static async Task Main(string[] args)
 {
     await HostedServiceProgram.RunAsync <Program, Startup>();
 }
示例#3
0
 public static async Task SubMain()
 {
     await HostedServiceProgram.RunAsync <DeployBuiltBinaries, DeployBuiltBinariesStartup>();
 }