diff --git a/samples/HotAddSample/project.json b/samples/HotAddSample/project.json index d6538aa090..923b80c29c 100644 --- a/samples/HotAddSample/project.json +++ b/samples/HotAddSample/project.json @@ -2,7 +2,7 @@ "version": "1.1.0-*", "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.2.0-*", - "Microsoft.Extensions.Logging.Console": "1.1.0-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "buildOptions": { "emitEntryPoint": true diff --git a/samples/SelfHostServer/project.json b/samples/SelfHostServer/project.json index f621b8021a..5687132a8e 100644 --- a/samples/SelfHostServer/project.json +++ b/samples/SelfHostServer/project.json @@ -1,7 +1,7 @@ { "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.2.0-*", - "Microsoft.Extensions.Logging.Console": "1.1.0-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "buildOptions": { "emitEntryPoint": true diff --git a/src/Microsoft.AspNetCore.Server.WebListener/project.json b/src/Microsoft.AspNetCore.Server.WebListener/project.json index 56cfd2f176..43e21fe3de 100644 --- a/src/Microsoft.AspNetCore.Server.WebListener/project.json +++ b/src/Microsoft.AspNetCore.Server.WebListener/project.json @@ -2,8 +2,8 @@ "version": "0.2.0-*", "description": "ASP.NET 5 self-host web server.", "dependencies": { - "Microsoft.AspNetCore.Hosting": "1.1.0-*", - "Microsoft.Net.Http.Headers": "1.1.0-*", + "Microsoft.AspNetCore.Hosting": "1.0.0", + "Microsoft.Net.Http.Headers": "1.0.0", "Microsoft.Net.Http.Server": "0.2.0-*" }, "buildOptions": { diff --git a/src/Microsoft.Net.Http.Server/NullLogger.cs b/src/Microsoft.Net.Http.Server/NullLogger.cs new file mode 100644 index 0000000000..8e82046da2 --- /dev/null +++ b/src/Microsoft.Net.Http.Server/NullLogger.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Open Technologies, Inc. +// All Rights Reserved +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING +// WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF +// TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR +// NON-INFRINGEMENT. +// See the Apache 2 License for the specific language governing +// permissions and limitations under the License. + +using System; +using Microsoft.Extensions.Logging; + +namespace Microsoft.Net.Http.Server +{ + internal class NullLogger : ILogger + { + public static readonly NullLogger Instance = new NullLogger(); + + public IDisposable BeginScope(TState state) + { + return NullDisposable.Instance; + } + + public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) + { + } + + public bool IsEnabled(LogLevel logLevel) + { + return false; + } + + private class NullDisposable : IDisposable + { + public static readonly NullDisposable Instance = new NullDisposable(); + + public void Dispose() + { + // intentionally does nothing + } + } + } +} diff --git a/src/Microsoft.Net.Http.Server/WebListenerSettings.cs b/src/Microsoft.Net.Http.Server/WebListenerSettings.cs index ce2bd122df..a952137227 100644 --- a/src/Microsoft.Net.Http.Server/WebListenerSettings.cs +++ b/src/Microsoft.Net.Http.Server/WebListenerSettings.cs @@ -17,7 +17,6 @@ using System; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; namespace Microsoft.Net.Http.Server { diff --git a/src/Microsoft.Net.Http.Server/project.json b/src/Microsoft.Net.Http.Server/project.json index c7083374f7..91402ad7d9 100644 --- a/src/Microsoft.Net.Http.Server/project.json +++ b/src/Microsoft.Net.Http.Server/project.json @@ -2,8 +2,8 @@ "version": "0.2.0-*", "description": "Implementation of WebListener, a successor to HttpListener. It is used in the WebListener server package.", "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "1.1.0-*", - "Microsoft.Extensions.Primitives": "1.1.0-*" + "Microsoft.Extensions.Logging.Abstractions": "1.0.0", + "Microsoft.Extensions.Primitives": "1.0.0" }, "buildOptions": { "allowUnsafe": true, diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json index d25973f484..0da4448638 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json @@ -7,7 +7,7 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Server.WebListener": "0.2.0-*", - "Microsoft.AspNetCore.Testing": "1.1.0-*", + "Microsoft.AspNetCore.Testing": "1.0.0-*", "xunit": "2.2.0-*" }, "frameworks": { diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json index 399d8dc19d..9a0a5948de 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json @@ -3,7 +3,7 @@ "dependencies": { "dotnet-test-xunit": "2.2.0-*", "Microsoft.Net.Http.Server": "0.2.0-*", - "Microsoft.AspNetCore.Testing": "1.1.0-*", + "Microsoft.AspNetCore.Testing": "1.0.0-*", "xunit": "2.2.0-*" }, "frameworks": {