diff --git a/src/Orchard/Mvc/HttpContextAccessor.cs b/src/Orchard/Mvc/HttpContextAccessor.cs index 8fe8e4f0a..91c7c3b0d 100644 --- a/src/Orchard/Mvc/HttpContextAccessor.cs +++ b/src/Orchard/Mvc/HttpContextAccessor.cs @@ -3,7 +3,6 @@ using System.Collections.Concurrent; using System.Web; using Autofac; using Orchard.Mvc.Extensions; -using Orchard.Settings; namespace Orchard.Mvc { public class HttpContextAccessor : IHttpContextAccessor { @@ -20,10 +19,11 @@ namespace Orchard.Mvc { } public HttpContextBase CreateContext(ILifetimeScope lifetimeScope) { - return new MvcModule.HttpContextPlaceholder(_threadStaticContexts, _contextKey, () => { - var baseUrl = lifetimeScope.Resolve().GetSiteSettings().BaseUrl; - return !String.IsNullOrEmpty(baseUrl) ? baseUrl : "http://localhost"; // Return a valid URL always. - }); + return new MvcModule.HttpContextPlaceholder( + _threadStaticContexts, + _contextKey, + () => "http://localhost" // Use a valid URL always for the fake request. The value itself doesn't matter. + ); } private HttpContextBase GetContext() {