Skip to content

Commit e658217

Browse files
committed
Drop Microsoft.AspNetCore.Http.Abstractions for netcoreapp3.1 and higher
1 parent 8844d52 commit e658217

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

src/Serilog.AspNetCore/Serilog.AspNetCore.csproj

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>Serilog support for ASP.NET Core logging</Description>
55
<VersionPrefix>4.0.1</VersionPrefix>
66
<Authors>Microsoft;Serilog Contributors</Authors>
7-
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
7+
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
@@ -32,9 +32,26 @@
3232
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
3333
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.0" />
3434
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
35-
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
3635
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8" />
3736
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.8" />
3837
</ItemGroup>
3938

39+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
40+
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
41+
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
42+
</ItemGroup>
43+
44+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
45+
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.2.0" />
46+
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
47+
</ItemGroup>
48+
49+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
50+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
51+
</ItemGroup>
52+
53+
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
54+
<FrameworkReference Include="Microsoft.AspNetCore.App" />
55+
</ItemGroup>
56+
4057
</Project>

src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
// limitations under the License.
1414

1515
using System;
16+
using Microsoft.Extensions.DependencyInjection;
1617
using Microsoft.AspNetCore.Hosting;
1718
using Microsoft.Extensions.Logging;
18-
using Serilog.Extensions.Logging;
19-
using Microsoft.Extensions.DependencyInjection;
2019
using Serilog.Extensions.Hosting;
20+
using Serilog.Extensions.Logging;
2121

2222
namespace Serilog
2323
{
@@ -77,7 +77,7 @@ public static IWebHostBuilder UseSerilog(
7777
/// The logger will be shut down when application services are disposed.
7878
/// </remarks>
7979
/// <param name="builder">The web host builder to configure.</param>
80-
/// <param name="configureLogger">The delegate for configuring the <see cref="LoggerConfiguration" /> that will be used to construct a <see cref="Logger" />.</param>
80+
/// <param name="configureLogger">The delegate for configuring the <see cref="LoggerConfiguration" /> that will be used to construct a <see cref="ILogger" />.</param>
8181
/// <param name="preserveStaticLogger">Indicates whether to preserve the value of <see cref="Log.Logger"/>.</param>
8282
/// <param name="writeToProviders">By default, Serilog does not write events to <see cref="ILoggerProvider"/>s registered through
8383
/// the Microsoft.Extensions.Logging API. Normally, equivalent Serilog sinks are used in place of providers. Specify

0 commit comments

Comments
 (0)