From ae0a195801f28c8bf8eb5e36173e41cba5a81360 Mon Sep 17 00:00:00 2001 From: Lombiq Date: Thu, 25 Dec 2014 00:10:45 +0100 Subject: [PATCH] Adding support for disabling Owin (with its standard appSettings config), and disabling it for Specs. This allows Specflow tests to be run, without Owin (since Owin prevented those tests from running, it requiring integrated pipeline that is not available when self-hosting through HttpRuntime). --- src/Orchard.Specs/Hosting/Orchard.Web/Web.config | 2 +- src/Orchard.Specs/Hosting/Simple.Web/Web.config | 1 + src/Orchard/Mvc/Routes/ShellRoute.cs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config index 8b00f2079..ef880caa1 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config @@ -23,7 +23,7 @@ - + diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Web.config b/src/Orchard.Specs/Hosting/Simple.Web/Web.config index c381340cf..9826c578e 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Simple.Web/Web.config @@ -25,6 +25,7 @@ + diff --git a/src/Orchard/Mvc/Routes/ShellRoute.cs b/src/Orchard/Mvc/Routes/ShellRoute.cs index c080d7d95..6fdafcc27 100644 --- a/src/Orchard/Mvc/Routes/ShellRoute.cs +++ b/src/Orchard/Mvc/Routes/ShellRoute.cs @@ -166,7 +166,8 @@ namespace Orchard.Mvc.Routes { var environment = context.Items["owin.Environment"] as IDictionary; if (environment == null) { - throw new ArgumentException("owin.Environment can't be null"); + // It seems Owin is disabled by the owin:AutomaticAppStartup=false appSettings configuration. + environment = new Dictionary(); } environment["orchard.Handler"] = new Func(async () => {