diff --git a/appveyor.yml b/appveyor.yml index 78df5a5..aa80e5e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,10 @@ skip_tags: true image: Visual Studio 2022 test: off build_script: -- ps: ./Build.ps1 +- pwsh: | + Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1" + ./dotnet-install.ps1 -JSonFile global.json -Architecture x64 -InstallDir 'C:\Program Files\dotnet' + ./Build.ps1 artifacts: - path: artifacts/Serilog.*.nupkg skip_commits: diff --git a/global.json b/global.json index 2c23bfe..d079f83 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": false, - "version": "7.0.100", + "version": "8.0.100", "rollForward": "latestFeature" } } diff --git a/samples/SimpleServiceSample/Program.cs b/samples/SimpleServiceSample/Program.cs index bd21ea5..ee7319f 100644 --- a/samples/SimpleServiceSample/Program.cs +++ b/samples/SimpleServiceSample/Program.cs @@ -1,6 +1,4 @@ using System; -using System.IO; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; @@ -38,6 +36,7 @@ public static IHostBuilder CreateHostBuilder(string[] args) => .ConfigureServices(services => services.AddHostedService()) .UseSerilog((context, services, loggerConfiguration) => loggerConfiguration .ReadFrom.Configuration(context.Configuration) + .ReadFrom.Services(services) .Enrich.FromLogContext() .WriteTo.Console()); } diff --git a/samples/SimpleServiceSample/SimpleServiceSample.csproj b/samples/SimpleServiceSample/SimpleServiceSample.csproj index c0736fa..3451be2 100644 --- a/samples/SimpleServiceSample/SimpleServiceSample.csproj +++ b/samples/SimpleServiceSample/SimpleServiceSample.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 @@ -9,9 +9,9 @@ - - - + + + diff --git a/samples/WebApplicationSample/Program.cs b/samples/WebApplicationSample/Program.cs index 3fcae13..4cf73b8 100644 --- a/samples/WebApplicationSample/Program.cs +++ b/samples/WebApplicationSample/Program.cs @@ -1,11 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Serilog; namespace WebApplicationSample diff --git a/samples/WebApplicationSample/WebApplicationSample.csproj b/samples/WebApplicationSample/WebApplicationSample.csproj index 587f02c..8fbe382 100644 --- a/samples/WebApplicationSample/WebApplicationSample.csproj +++ b/samples/WebApplicationSample/WebApplicationSample.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/Serilog.Extensions.Hosting/Serilog.Extensions.Hosting.csproj b/src/Serilog.Extensions.Hosting/Serilog.Extensions.Hosting.csproj index c914b3c..edeb7db 100644 --- a/src/Serilog.Extensions.Hosting/Serilog.Extensions.Hosting.csproj +++ b/src/Serilog.Extensions.Hosting/Serilog.Extensions.Hosting.csproj @@ -3,11 +3,11 @@ Serilog support for .NET Core logging in hosted services - 7.0.0 + 8.0.0 Microsoft;Serilog Contributors - net462;netstandard2.0;netstandard2.1;net6.0;net7.0 + net462;netstandard2.0;net6.0;net7.0;net8.0 8 true true @@ -22,6 +22,7 @@ git false Serilog + README.md @@ -30,15 +31,16 @@ + - + - - - - + + + + diff --git a/test/Serilog.Extensions.Hosting.Tests/Serilog.Extensions.Hosting.Tests.csproj b/test/Serilog.Extensions.Hosting.Tests/Serilog.Extensions.Hosting.Tests.csproj index e83da0d..39904a4 100644 --- a/test/Serilog.Extensions.Hosting.Tests/Serilog.Extensions.Hosting.Tests.csproj +++ b/test/Serilog.Extensions.Hosting.Tests/Serilog.Extensions.Hosting.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0;net4.8 + net4.8;net6.0;net7.0;net8.0 ../../assets/Serilog.snk true true @@ -17,10 +17,10 @@ - - - - + + + +