From 98af58a25111840c089fe820b30bbe4ea090a2bc Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 10 Dec 2024 23:32:37 +0800 Subject: [PATCH] feat: remove netstandard2.1/net6.0/net7.0 --- Directory.Build.props | 2 +- Directory.Packages.props | 5 ++--- global.json | 2 +- src/Directory.Build.props | 3 ++- src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs | 2 +- .../WeihanLi.Common.Logging.Serilog.csproj | 2 +- src/WeihanLi.Common/Extensions/ProcessExtension.cs | 4 ++-- src/WeihanLi.Common/WeihanLi.Common.csproj | 4 +--- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 017b90d5..4c07496c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - latest + preview enable enable WeihanLi diff --git a/Directory.Packages.props b/Directory.Packages.props index e15ba918..b78a8133 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -2,8 +2,7 @@ true - 6.0.0 - 7.0.0 + 8.0.0 8.0.0 9.0.0 @@ -39,6 +38,6 @@ - + \ No newline at end of file diff --git a/global.json b/global.json index 770802cd..55270c88 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "rollForward": "latestMajor", - "version": "8.0.100", + "version": "9.0.101", "allowPrerelease": true } } \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 43ec29e7..5ca21a36 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -23,7 +23,8 @@ icon.jpg README.md MIT - Preview + preview + $(NoWarn);CS9216; diff --git a/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs b/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs index bbe2293e..1ad730dd 100644 --- a/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs +++ b/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs @@ -39,7 +39,7 @@ public bool IsEnabled(LogLevel logLevel) return _logger.IsEnabled(ConvertLevel(logLevel)); } - public IDisposable BeginScope(TState state) + public IDisposable? BeginScope(TState state) where TState : notnull { return _provider.BeginScope(state); } diff --git a/src/WeihanLi.Common.Logging.Serilog/WeihanLi.Common.Logging.Serilog.csproj b/src/WeihanLi.Common.Logging.Serilog/WeihanLi.Common.Logging.Serilog.csproj index a6776692..0090c715 100644 --- a/src/WeihanLi.Common.Logging.Serilog/WeihanLi.Common.Logging.Serilog.csproj +++ b/src/WeihanLi.Common.Logging.Serilog/WeihanLi.Common.Logging.Serilog.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net6.0;net9.0 + netstandard2.0;net8.0;net9.0 https://github.com/WeihanLi/WeihanLi.Common/tree/dev/src/WeihanLi.Common.Logging.Serilog MIT $(PackageTags);logging;serilog diff --git a/src/WeihanLi.Common/Extensions/ProcessExtension.cs b/src/WeihanLi.Common/Extensions/ProcessExtension.cs index a4d28f0b..ac44066e 100644 --- a/src/WeihanLi.Common/Extensions/ProcessExtension.cs +++ b/src/WeihanLi.Common/Extensions/ProcessExtension.cs @@ -121,12 +121,12 @@ public static CommandResult GetResult(this ProcessStartInfo psi) public static async Task GetResultAsync(this ProcessStartInfo psi, CancellationToken cancellationToken = default) { var stdOutStringBuilder = new StringBuilder(); -#if NETSTANDARD2_1 || NET6_0_OR_GREATER +#if NET await #endif using var stdOut = new StringWriter(stdOutStringBuilder); var stdErrStringBuilder = new StringBuilder(); -#if NETSTANDARD2_1 || NET6_0_OR_GREATER +#if NET await #endif using var stdErr = new StringWriter(stdErrStringBuilder); diff --git a/src/WeihanLi.Common/WeihanLi.Common.csproj b/src/WeihanLi.Common/WeihanLi.Common.csproj index d6b74e56..f74b78da 100644 --- a/src/WeihanLi.Common/WeihanLi.Common.csproj +++ b/src/WeihanLi.Common/WeihanLi.Common.csproj @@ -2,7 +2,7 @@ WeihanLi.Common WeihanLi.Common - netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0;net9.0 + netstandard2.0;net8.0;net9.0 common libarary,extensions helpers and useful utilities $(PackageTags);common;utility;lib;libarary;extensions;helpers common libarary,extensions helpers and useful utilities @@ -18,8 +18,6 @@ - -