diff --git a/src/Microsoft.AspNet.Hosting/HostingServices.cs b/src/Microsoft.AspNet.Hosting/HostingServices.cs index 0a0950d559..91e1ef5f31 100644 --- a/src/Microsoft.AspNet.Hosting/HostingServices.cs +++ b/src/Microsoft.AspNet.Hosting/HostingServices.cs @@ -51,8 +51,8 @@ namespace Microsoft.AspNet.Hosting yield return describer.Instance(new ApplicationLifetime()); - // TODO: We expect this to be provide by the runtime eventually. - yield return describer.Instance(new NullLoggerFactory()); + // TODO: Do we expect this to be provide by the runtime eventually? + yield return describer.Singleton(); yield return new ServiceDescriptor { @@ -76,38 +76,5 @@ namespace Microsoft.AspNet.Hosting yield return describer.Instance(DataProtectionProvider.CreateFromDpapi()); } } - - // TODO: Temp workaround until the runtime reliably provides logging. - // If ILoggerFactory is never guaranteed, move this fallback into Microsoft.AspNet.Logging. - private class NullLoggerFactory : ILoggerFactory - { - public ILogger Create(string name) - { - return new NullLogger(); - } - } - - private class NullLogger : ILogger - { - public bool WriteCore(TraceType eventType, int eventId, object state, Exception exception, Func formatter) - { - return false; - } - - public IDisposable BeginScope(object state) - { - return NullScope.Instance; - } - } - - private class NullScope : IDisposable - { - public static NullScope Instance = new NullScope(); - - public void Dispose() - { - // intentionally does nothing - } - } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.TestHost.Tests/TestApplicationEnvironment.cs b/test/Microsoft.AspNet.TestHost.Tests/TestApplicationEnvironment.cs index 417a903d0d..28d5ba7b24 100644 --- a/test/Microsoft.AspNet.TestHost.Tests/TestApplicationEnvironment.cs +++ b/test/Microsoft.AspNet.TestHost.Tests/TestApplicationEnvironment.cs @@ -36,5 +36,10 @@ namespace Microsoft.AspNet.TestHost { get { return new FrameworkName(".NETFramework", new Version(4, 5)); } } + + public string Configuration + { + get { return "Test"; } + } } }