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).

This commit is contained in:
Lombiq
2014-12-25 00:10:45 +01:00
committed by Zoltán Lehóczky
parent 4845e2dc4b
commit ae0a195801
3 changed files with 4 additions and 2 deletions

View File

@@ -23,7 +23,7 @@
<add key="webpages:Enabled" value="false" />
<add key="webpages:Version" value="3.0.0.0"/>
<add key="log4net.Config" value="Config\log4net.config" />
<add key="owin:AppStartup" value="Orchard.Owin.Startup, Orchard.Framework" />
<add key="owin:AutomaticAppStartup" value="false" />
</appSettings>
<system.web.webPages.razor>

View File

@@ -25,6 +25,7 @@
<appSettings>
<add key="webpages:Enabled" value="false" />
<add key="owin:AutomaticAppStartup" value="false" />
</appSettings>

View File

@@ -166,7 +166,8 @@ namespace Orchard.Mvc.Routes {
var environment = context.Items["owin.Environment"] as IDictionary<string, object>;
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<string, object>();
}
environment["orchard.Handler"] = new Func<Task>(async () => {