示例#1
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            NLoggerWrapper.InitConfig();
            DotBPE.Rpc.Environment.SetLogger(new NLoggerWrapper(typeof(Program)));

            string[] runArgs = new string[] { "--server", "127.0.0.1:6203", "--testcase", "auth_create" };
            InteropClient.Run(runArgs);
        }
示例#2
0
        public static void Main(string[] args)
        {
            NLoggerWrapper.InitConfig();
            DotBPE.Rpc.Environment.SetLogger(new NLoggerWrapper(typeof(Program)));

            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseIISIntegration()
                       .UseStartup <Startup>()
                       .Build();

            host.Run();
        }
示例#3
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;

            NLoggerWrapper.InitConfig();
            DotBPE.Rpc.Environment.SetLogger(new NLoggerWrapper(typeof(Program)));

            var host = new RpcHostBuilder()
                       .UseStartup <Startup>()
                       .Build();

            host.StartAsync().Wait();

            Console.WriteLine("Press any key to quit!");
            Console.ReadKey();

            host.ShutdownAsync().Wait();
        }
示例#4
0
        public static async Task <IServerHost> StartAsync <TStartup>() where TStartup : IStartup
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            //从配置文件中 读取NLog配置
            NLoggerWrapper.InitConfig();
            //设置DotBPE内部类如何使用Logger,这里使用NLog,不配置,默认输出日志
            DotBPE.Rpc.Environment.SetLogger(new NLoggerWrapper(typeof(InteropServer)));

            // 读取json 配置
            var builder       = new ConfigurationBuilder().AddJsonFile("dotbpe.config.json");
            var configuration = builder.Build();



            // 创建Host
            var host = new RpcHostBuilder()
                       .UseConfiguration(configuration)
                       .UseStartup <TStartup>()
                       .Build();

            await host.StartAsync();

            return(host);
        }