当前位置: 首页>>代码示例>>C#>>正文


C# IAppBuilder.UseShowExceptions方法代码示例

本文整理汇总了C#中IAppBuilder.UseShowExceptions方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseShowExceptions方法的具体用法?C# IAppBuilder.UseShowExceptions怎么用?C# IAppBuilder.UseShowExceptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAppBuilder的用法示例。


在下文中一共展示了IAppBuilder.UseShowExceptions方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configuration

        public void Configuration(IAppBuilder app)
        {
            var settings = new ApplicationSettings();

            if (settings.MigrateDatabase)
            {
                // Perform the required migrations
                DoMigrations();
            }

            var kernel = SetupNinject(settings);

            app.Use(typeof(DetectSchemeHandler));

            if (settings.RequireHttps)
            {
                app.Use(typeof(RequireHttpsHandler));
            }

            app.UseShowExceptions();

            // This needs to run before everything
            app.Use(typeof(AuthorizationHandler), kernel.Get<IAuthenticationTokenService>());

            SetupSignalR(kernel, app);
            SetupWebApi(kernel, app);
            SetupMiddleware(settings, app);
            SetupNancy(kernel, app);

            SetupErrorHandling();
        }
开发者ID:bartsipes,项目名称:JabbR,代码行数:31,代码来源:Startup.cs

示例2: Configuration

        public void Configuration(IAppBuilder app)
        {
            var settings = new ApplicationSettings();

            if (settings.MigrateDatabase)
            {
                // Perform the required migrations
                DoMigrations();
            }

            var kernel = SetupNinject(settings);

            app.Use(typeof(DetectSchemeHandler));

            if (settings.RequireHttps)
            {
                app.Use(typeof(RequireHttpsHandler));
            }

            app.UseShowExceptions();

            SetupAuth(app, kernel);
            SetupSignalR(kernel, app);
            SetupWebApi(kernel, app);
            SetupMiddleware(kernel, app, settings);
            SetupNancy(kernel, app);

            SetupErrorHandling();
        }
开发者ID:buybackoff,项目名称:JabbR,代码行数:29,代码来源:Startup.cs

示例3: Configuration

        public void Configuration(IAppBuilder app)
        {
            app.UseFunc(LogBefore);
            app.UseShowExceptions();
            app.UseStatic(".", new List<string> { "/favicon.ico", "/images", "/html", "/css" });

            app.Run(WebApp.App(new GmcJobList()));
        }
开发者ID:karasek,项目名称:OWIN-Test-Samples,代码行数:8,代码来源:Startup.cs

示例4: Alternative

        public void Alternative(IAppBuilder builder)
        {
            Assembly.Load("Nancy.ViewEngines.Spark");

            builder
                .UseShowExceptions()
                .UseContentType()
                .Map("/wilson", Wilson.App())
                .Map("/wilsonasync", Wilson.App(true))
                .UseCascade(DefaultPage.App())
                .RunNancy();
        }
开发者ID:kevinswiber,项目名称:gate,代码行数:12,代码来源:Startup.cs

示例5: Configuration

        public void Configuration(IAppBuilder builder)
        {
            Assembly.Load("Nancy.ViewEngines.Spark");

            builder
                .UseShowExceptions()
                .UseContentType()
                .Map("/wilson", map => map.Run(Wilson.App))
                .Map("/wilsonasync", map => map.Run(Wilson.App, true))
                .RunCascade(
                    x => x.RunDefaultPage(),
                    x => x.RunNancy());
        }
开发者ID:kevinswiber,项目名称:gate,代码行数:13,代码来源:Startup.cs

示例6: Configuration

        public void Configuration(IAppBuilder appBuilder)
        {
            var bootstrapper = new Bootstrapper();
            var container = bootstrapper.Bootstrap();
            var routeManager = container.GetInstance<IRouteManager>();

            appBuilder.UseShowExceptions()
                      .UseContentType()
                      .Map("/", IndexRoute)
                      .Map("/robots.txt", RobotsRoute)
                      .Map("/adapters/", env => AdapterRoutes(routeManager, env));

            SetupErrorHandling();
        }
开发者ID:xt0rted,项目名称:JibbR,代码行数:14,代码来源:Startup.cs

示例7: Configuration

        public void Configuration(IAppBuilder app)
        {
            // OWIN logging
            app.Use(typeof(Logger));

            // return exception details in case of an error
            app.UseShowExceptions();

            // Configure WebApi
            var config = new HttpConfiguration();
            config.Routes.MapHttpRoute("API Default", "api/{controller}/{id}", new { id = RouteParameter.Optional });
            app.UseWebApi(config);

            // Configure SignalR
            app.MapHubs();

            // Configure StaticFiles
            app.UseStaticFiles("StaticFiles");

            // Display 'Welcome to Kantana', when nothing else is found
            app.UseTestPage();
        }
开发者ID:Ritzlgrmft,项目名称:OwinConfiguration,代码行数:22,代码来源:Startup.cs

示例8: Configuration

        public void Configuration(IAppBuilder app)
        {
            // Perform the required migrations
            DoMigrations();

            var kernel = new StandardKernel(new[] { new FactoryModule() });

            kernel.Bind<JabbrContext>()
                .To<JabbrContext>();

            kernel.Bind<IJabbrRepository>()
                .To<PersistedRepository>();

            kernel.Bind<IChatService>()
                  .To<ChatService>();

            kernel.Bind<IAuthenticationTokenService>()
                  .To<AuthenticationTokenService>();

            // We're doing this manually since we want the chat repository to be shared
            // between the chat service and the chat hub itself
            kernel.Bind<Chat>()
                  .ToMethod(context =>
                  {
                      var resourceProcessor = context.Kernel.Get<IResourceProcessor>();
                      var repository = context.Kernel.Get<IJabbrRepository>();
                      var cache = context.Kernel.Get<ICache>();

                      var service = new ChatService(cache, repository);

                      return new Chat(resourceProcessor,
                                      service,
                                      repository,
                                      cache);
                  });

            kernel.Bind<ICryptoService>()
                .To<CryptoService>()
                .InSingletonScope();

            kernel.Bind<IResourceProcessor>()
                .To<ResourceProcessor>()
                .InSingletonScope();

            kernel.Bind<IApplicationSettings>()
                  .To<ApplicationSettings>()
                  .InSingletonScope();

            kernel.Bind<IJavaScriptMinifier>()
                  .To<AjaxMinMinifier>()
                  .InSingletonScope();

            kernel.Bind<IMembershipService>()
                  .To<MembershipService>();

            kernel.Bind<IAuthenticationService>()
                  .ToConstant(new AuthenticationService());

            kernel.Bind<IAuthenticationCallbackProvider>()
                      .To<JabbRAuthenticationCallbackProvider>();

            kernel.Bind<ICache>()
                  .To<DefaultCache>()
                  .InSingletonScope();

            try
            {
                if (app.IsRunningUnderSystemWeb())
                {
                    BindSystemWebDependencies(kernel);
                }
            }
            catch (Exception ex)
            {
                // If we were unable to load the system web specific dependencies don't cry about it
                ReportError(ex);
            }

            var serializer = new JsonNetSerializer(new JsonSerializerSettings
            {
                DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
            });

            kernel.Bind<IJsonSerializer>()
                  .ToConstant(serializer);

            app.Use(typeof(DetectSchemeHandler));

            var settings = kernel.Get<IApplicationSettings>();
            if (settings.RequireHttps)
            {
                app.Use(typeof(RequireHttpsHandler));
            }

            app.UseShowExceptions();

            // This needs to run before everything
            app.Use(typeof(AuthorizationHandler), kernel.Get<IAuthenticationTokenService>());

            SetupSignalR(kernel, app);
//.........这里部分代码省略.........
开发者ID:arri-cc,项目名称:JabbR,代码行数:101,代码来源:Startup.cs

示例9: ConfigWilson

 void ConfigWilson(IAppBuilder builder)
 {
     builder.UseShowExceptions().Run(Wilson.App());
 }
开发者ID:dragan,项目名称:gate,代码行数:4,代码来源:Startup.cs

示例10: Debug

 public static void Debug(IAppBuilder builder)
 {
     builder
         .UseShowExceptions()
         .RunNancy();
 }
开发者ID:majimenezp,项目名称:EjemplosNancy,代码行数:6,代码来源:Startup.cs

示例11: Configuration


//.........这里部分代码省略.........
            kernel.Bind<JabbrContext>()
                .To<JabbrContext>();

            kernel.Bind<IJabbrRepository>()
                .To<PersistedRepository>();

            kernel.Bind<IChatService>()
                  .To<ChatService>();

            kernel.Bind<IAuthenticationTokenService>()
                  .To<AuthenticationTokenService>();

            // We're doing this manually since we want the chat repository to be shared
            // between the chat service and the chat hub itself
            kernel.Bind<Chat>()
                  .ToMethod(context =>
                  {
                      var resourceProcessor = context.Kernel.Get<IResourceProcessor>();
                      var repository = context.Kernel.Get<IJabbrRepository>();
                      var cache = context.Kernel.Get<ICache>();

                      var service = new ChatService(cache, repository);

                      return new Chat(resourceProcessor,
                                      service,
                                      repository,
                                      cache);
                  });

            kernel.Bind<ICryptoService>()
                .To<CryptoService>()
                .InSingletonScope();

            kernel.Bind<IResourceProcessor>()
                .To<ResourceProcessor>()
                .InSingletonScope();

            kernel.Bind<IApplicationSettings>()
                  .ToConstant(settings);

            kernel.Bind<IJavaScriptMinifier>()
                  .To<AjaxMinMinifier>()
                  .InSingletonScope();

            kernel.Bind<IMembershipService>()
                  .To<MembershipService>();

            kernel.Bind<IAuthenticationService>()
                  .ToConstant(new AuthenticationService());

            kernel.Bind<IAuthenticationCallbackProvider>()
                      .To<JabbRAuthenticationCallbackProvider>();

            kernel.Bind<ICache>()
                  .To<DefaultCache>()
                  .InSingletonScope();

            kernel.Bind<IChatNotificationService>()
                  .To<ChatNotificationService>();

            if (String.IsNullOrEmpty(settings.VerificationKey) ||
                String.IsNullOrEmpty(settings.EncryptionKey))
            {
                kernel.Bind<IKeyProvider>()
                      .ToConstant(new FileBasedKeyProvider());
            }
            else
            {
                kernel.Bind<IKeyProvider>()
                      .To<AppSettingKeyProvider>()
                      .InSingletonScope();
            }

            var serializer = new JsonNetSerializer(new JsonSerializerSettings
            {
                DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
            });

            kernel.Bind<IJsonSerializer>()
                  .ToConstant(serializer);

            app.Use(typeof(DetectSchemeHandler));

            if (settings.RequireHttps)
            {
                app.Use(typeof(RequireHttpsHandler));
            }

            app.UseShowExceptions();

            // This needs to run before everything
            app.Use(typeof(AuthorizationHandler), kernel.Get<IAuthenticationTokenService>());

            SetupSignalR(kernel, app);
            SetupWebApi(kernel, app);
            SetupMiddleware(app);
            SetupNancy(kernel, app);

            SetupErrorHandling();
        }
开发者ID:sgwill,项目名称:JabbR,代码行数:101,代码来源:Startup.cs


注:本文中的IAppBuilder.UseShowExceptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。