Lifting up where the hosted test is

This commit is contained in:
Aaron Powell
2019-02-15 16:41:50 +11:00
parent c50daf87a5
commit 0aae5c1df1

View File

@@ -73,8 +73,12 @@ namespace Umbraco.Web.Runtime
// setup mvc and webapi services
SetupMvcAndWebApi();
// client dependency
ConfigureClientDependency(_globalSettings);
// When using a non-web runtime and this component is loaded ClientDependency explodes because it'll
// want to access HttpContext.Current, which doesn't exist
if (IOHelper.IsHosted)
{
ConfigureClientDependency(_globalSettings);
}
// Disable the X-AspNetMvc-Version HTTP Header
MvcHandler.DisableMvcResponseHeader = true;
@@ -278,10 +282,7 @@ namespace Umbraco.Web.Runtime
{ "compositeFileHandlerPath", ClientDependencySettings.Instance.CompositeFileHandlerPath }
});
// When using a non-web runtime and this component is loaded ClientDependency explodes because it'll
// want to access HttpContext.Current, which doesn't exist
if (IOHelper.IsHosted)
ClientDependencySettings.Instance.MvcRendererCollection.Add(renderer);
ClientDependencySettings.Instance.MvcRendererCollection.Add(renderer);
}
}
}