本文整理汇总了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();
}
示例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();
}
示例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()));
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
示例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);
//.........这里部分代码省略.........
示例9: ConfigWilson
void ConfigWilson(IAppBuilder builder)
{
builder.UseShowExceptions().Run(Wilson.App());
}
示例10: Debug
public static void Debug(IAppBuilder builder)
{
builder
.UseShowExceptions()
.RunNancy();
}
示例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();
}