diff --git a/src/Microsoft.AspNet.Hosting/HostingServices.cs b/src/Microsoft.AspNet.Hosting/HostingServices.cs index 3f9555448e..4ef1e162c6 100644 --- a/src/Microsoft.AspNet.Hosting/HostingServices.cs +++ b/src/Microsoft.AspNet.Hosting/HostingServices.cs @@ -30,6 +30,13 @@ namespace Microsoft.AspNet.Hosting yield return describer.Transient(); + yield return new ServiceDescriptor + { + ServiceType = typeof(IContextAccessor<>), + ImplementationType = typeof(ContextAccessor<>), + Lifecycle = LifecycleKind.Scoped + }; + // The default IDataProtectionProvider is a singleton. // Note: DPAPI isn't usable in IIS where the user profile hasn't been loaded, but loading DPAPI // is deferred until the first call to Protect / Unprotect. It's up to an IIS-based host to