From a278b69bcb21562c4e5f931473f0e68fddd1ac41 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 20:46:57 +0800 Subject: [PATCH 01/13] feat: NoWarn on NETSDK1057 --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9e8d1c8c..94e0c480 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ git WeihanLi Copyright 2017-$([System.DateTime]::Now.Year) (c) WeihanLi - $(NoWarn);NU5048;CS1591 + $(NoWarn);NU5048;CS1591;NETSDK1057 true From d009d731d885f0620f1f844f5c227e329d37ec7e Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 20:58:28 +0800 Subject: [PATCH 02/13] feat: NoWarn on NETSDK1057 NETSDK1057 using preview sdk --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 94e0c480..810d6e1e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ git WeihanLi Copyright 2017-$([System.DateTime]::Now.Year) (c) WeihanLi - $(NoWarn);NU5048;CS1591;NETSDK1057 + $(NoWarn);NU5048;CS1591;NETSDK1057 true From 9f90686736ebcb258fbd6c3af64c0bc61453f3ef Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 21:00:28 +0800 Subject: [PATCH 03/13] feat: enable artifacts $(MSBuildThisFileDirectory)artifacts --- Directory.Build.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 810d6e1e..1ac00e34 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,8 @@ git WeihanLi Copyright 2017-$([System.DateTime]::Now.Year) (c) WeihanLi - $(NoWarn);NU5048;CS1591;NETSDK1057 + $(NoWarn);NU5048;CS1591;NETSDK1057 + $(MSBuildThisFileDirectory)artifacts true From 432ba84b411fbda0a575dbaccbfb4fef4a0f4263 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 21:05:04 +0800 Subject: [PATCH 04/13] refactor: move CLSCompliantAttribute to project file --- src/WeihanLi.Common/WeihanLi.Common.csproj | 5 +++++ src/WeihanLi.Common/_HackyThings.cs | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) delete mode 100644 src/WeihanLi.Common/_HackyThings.cs diff --git a/src/WeihanLi.Common/WeihanLi.Common.csproj b/src/WeihanLi.Common/WeihanLi.Common.csproj index e38e3f02..b7794254 100644 --- a/src/WeihanLi.Common/WeihanLi.Common.csproj +++ b/src/WeihanLi.Common/WeihanLi.Common.csproj @@ -20,6 +20,11 @@ + + + <_Parameter1>true + + diff --git a/src/WeihanLi.Common/_HackyThings.cs b/src/WeihanLi.Common/_HackyThings.cs deleted file mode 100644 index f5476101..00000000 --- a/src/WeihanLi.Common/_HackyThings.cs +++ /dev/null @@ -1 +0,0 @@ -[assembly: CLSCompliant(true)] From 806f0190c0694ffe52e9385b348428c79d297feb Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 21:07:09 +0800 Subject: [PATCH 05/13] ci: disable pre-commit git hook --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index a26139c7..5945bff3 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -8,4 +8,4 @@ # dotnet husky run --name "format-verify" # run tasks by task group name -dotnet husky run --group pre-commit +# dotnet husky run --group pre-commit From 71c5f2ab7df08b7d7ca5a2bbed988ae2ebcfd4af Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 21:36:02 +0800 Subject: [PATCH 06/13] refactor: refactor TimerBaseBackgroundService/CronBasedBackgroundService --- samples/DotNetCoreSample/AppHostTest.cs | 5 ++-- .../Hosting/CronBasedBackgroundService.cs | 16 ++++++++---- .../Hosting/TimerBaseBackgroundService.cs | 26 +++++++++---------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/samples/DotNetCoreSample/AppHostTest.cs b/samples/DotNetCoreSample/AppHostTest.cs index 101132d9..e60a99e1 100644 --- a/samples/DotNetCoreSample/AppHostTest.cs +++ b/samples/DotNetCoreSample/AppHostTest.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Console; +using System.Diagnostics; using System.Net; using System.Text.Encodings.Web; using System.Text.Json; @@ -38,7 +39,7 @@ public static async Task MainTest() { protected override TimeSpan Period => TimeSpan.FromSeconds(1); - protected override Task TimedTask(CancellationToken cancellationToken) + protected override Task ExecuteTaskAsync(CancellationToken cancellationToken) { Console.WriteLine(DateTimeOffset.Now); return Task.CompletedTask; @@ -53,7 +54,7 @@ public DiagnosticBackgroundService(IServiceProvider serviceProvider) : base(serv protected override string CronExpression => CronHelper.Secondly; - protected override Task TimedTask(IServiceProvider serviceProvider, CancellationToken cancellationToken) + protected override Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, Activity? activity, CancellationToken cancellationToken) { Console.WriteLine(DateTimeOffset.Now); return Task.CompletedTask; diff --git a/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs b/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs index 4a4dc6fc..79405070 100644 --- a/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs +++ b/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.Diagnostics; +using System.Diagnostics.Metrics; namespace WeihanLi.Common.Helpers.Hosting; @@ -11,7 +12,7 @@ public abstract class CronBasedBackgroundService : BackgroundService { protected abstract string CronExpression { get; } - protected abstract Task TimedTask(CancellationToken cancellationToken); + protected abstract Task ExecuteTaskAsync(CancellationToken cancellationToken); protected override async Task ExecuteAsync(CancellationToken stoppingToken) { @@ -21,7 +22,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) var now = DateTimeOffset.UtcNow; if (now >= next) { - _ = TimedTask(stoppingToken); + _ = ExecuteTaskAsync(stoppingToken); next = CronHelper.GetNextOccurrence(CronExpression); if (!next.HasValue) break; } @@ -37,31 +38,36 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) public abstract class CronBasedBackgroundServiceWithDiagnostic : CronBasedBackgroundService { private readonly IServiceProvider _serviceProvider; + private readonly Counter _executeCounter; protected CronBasedBackgroundServiceWithDiagnostic(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; + _executeCounter = DiagnosticHelper.Meter.CreateCounter("cron-service-executed-counter", "count", "CronBasedBackgroundService execute count(status:[0: success, -1: error])"); Logger = serviceProvider.GetRequiredService() .CreateLogger(GetType()); } protected ILogger Logger { get; } - protected abstract Task TimedTask(IServiceProvider serviceProvider, CancellationToken cancellationToken); - protected override async Task TimedTask(CancellationToken cancellationToken) + protected abstract Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, Activity? activity, CancellationToken cancellationToken); + + protected override async Task ExecuteTaskAsync(CancellationToken cancellationToken) { using var scope = _serviceProvider.CreateScope(); using var activity = DiagnosticHelper.ActivitySource.StartActivity(); try { Logger.LogInformation("BackgroundService execute begin"); - await TimedTask(scope.ServiceProvider, cancellationToken); + await ExecuteTaskInternalAsync(scope.ServiceProvider, activity, cancellationToken); Logger.LogInformation("BackgroundService execute end"); + if (_executeCounter.Enabled) _executeCounter.Add(1, new KeyValuePair("status", "0")); } catch (Exception e) { activity?.SetStatus(ActivityStatusCode.Error, e.Message); Logger.LogError(e, "BackgroundService execute exception"); + if (_executeCounter.Enabled) _executeCounter.Add(1, new KeyValuePair("status", "-1")); } } } diff --git a/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs b/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs index 54bf2108..add773b8 100644 --- a/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs +++ b/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs @@ -13,14 +13,14 @@ namespace WeihanLi.Common.Helpers.Hosting; public abstract class TimerBaseBackgroundService : BackgroundService { protected abstract TimeSpan Period { get; } - protected abstract Task TimedTask(CancellationToken cancellationToken); + protected abstract Task ExecuteTaskAsync(CancellationToken cancellationToken); protected override async Task ExecuteAsync(CancellationToken stoppingToken) { using var timer = new PeriodicTimer(Period); while (await timer.WaitForNextTickAsync(stoppingToken).ConfigureAwait(false)) { - await TimedTask(stoppingToken).ConfigureAwait(false); + await ExecuteTaskAsync(stoppingToken).ConfigureAwait(false); } } } @@ -28,36 +28,36 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) public abstract class TimerBaseBackgroundServiceWithDiagnostic : TimerBaseBackgroundService { private readonly IServiceProvider _serviceProvider; - private readonly Counter _executeSuccessCounter, _executeErrorCounter; + private readonly Counter _executeCounter; protected TimerBaseBackgroundServiceWithDiagnostic(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; - Logger = serviceProvider.GetRequiredService() + _executeCounter = DiagnosticHelper.Meter.CreateCounter("timer-service-executed-counter", "count", "TimerBaseBackgroundService execute count(status:[0: success, -1: error])"); + Logger = _serviceProvider.GetRequiredService() .CreateLogger(GetType()); - _executeSuccessCounter = DiagnosticHelper.Meter.CreateCounter("timer-service-executed-counter", "count", "Background service count"); - _executeErrorCounter = DiagnosticHelper.Meter.CreateCounter("timer-service-execute-error-counter", "count", "Background service count"); } - - protected ILogger Logger { get;} - protected abstract Task TimedTask(IServiceProvider serviceProvider, CancellationToken cancellationToken); - protected override async Task TimedTask(CancellationToken cancellationToken) + protected ILogger Logger { get; } + + protected abstract Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, Activity? activity, CancellationToken cancellationToken); + + protected override async Task ExecuteTaskAsync(CancellationToken cancellationToken) { using var scope = _serviceProvider.CreateScope(); using var activity = DiagnosticHelper.ActivitySource.StartActivity(); try { Logger.LogInformation("BackgroundService execute begin"); - await TimedTask(scope.ServiceProvider, cancellationToken); + await ExecuteTaskInternalAsync(scope.ServiceProvider, activity, cancellationToken); Logger.LogInformation("BackgroundService execute end"); - if (_executeSuccessCounter.Enabled) _executeSuccessCounter.Add(1); + if (_executeCounter.Enabled) _executeCounter.Add(1, new KeyValuePair("status", "0")); } catch (Exception e) { activity?.SetStatus(ActivityStatusCode.Error, e.Message); Logger.LogError(e, "BackgroundService execute exception"); - if (_executeErrorCounter.Enabled) _executeErrorCounter.Add(1); + if (_executeCounter.Enabled) _executeCounter.Add(1, new KeyValuePair("status", "-1")); } } } From e9bfc9f17cab526d4eebde053719d43bb64144f4 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 21:45:00 +0800 Subject: [PATCH 07/13] refactor: add enable code analysis config(disabled for now) --- src/Directory.Build.props | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 74537fc3..ddbc4f2a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,8 +1,13 @@ - - true + + + https://github.com/WeihanLi/WeihanLi.Common true From 15a2eb932a35ed3c0975cd5fecfafaca7da02fe6 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 21:50:09 +0800 Subject: [PATCH 08/13] refactor: remove activity from BackgroundService ExecuteTaskInternalAsync removed since Argument type 'Activity' is not CLS-compliant --- samples/DotNetCoreSample/AppHostTest.cs | 3 +-- .../Helpers/Hosting/CronBasedBackgroundService.cs | 4 ++-- .../Helpers/Hosting/TimerBaseBackgroundService.cs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/samples/DotNetCoreSample/AppHostTest.cs b/samples/DotNetCoreSample/AppHostTest.cs index e60a99e1..da1d4692 100644 --- a/samples/DotNetCoreSample/AppHostTest.cs +++ b/samples/DotNetCoreSample/AppHostTest.cs @@ -5,7 +5,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Console; -using System.Diagnostics; using System.Net; using System.Text.Encodings.Web; using System.Text.Json; @@ -54,7 +53,7 @@ public DiagnosticBackgroundService(IServiceProvider serviceProvider) : base(serv protected override string CronExpression => CronHelper.Secondly; - protected override Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, Activity? activity, CancellationToken cancellationToken) + protected override Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken) { Console.WriteLine(DateTimeOffset.Now); return Task.CompletedTask; diff --git a/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs b/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs index 79405070..bde9cbd0 100644 --- a/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs +++ b/src/WeihanLi.Common/Helpers/Hosting/CronBasedBackgroundService.cs @@ -50,7 +50,7 @@ protected CronBasedBackgroundServiceWithDiagnostic(IServiceProvider serviceProvi protected ILogger Logger { get; } - protected abstract Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, Activity? activity, CancellationToken cancellationToken); + protected abstract Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken); protected override async Task ExecuteTaskAsync(CancellationToken cancellationToken) { @@ -59,7 +59,7 @@ protected override async Task ExecuteTaskAsync(CancellationToken cancellationTok try { Logger.LogInformation("BackgroundService execute begin"); - await ExecuteTaskInternalAsync(scope.ServiceProvider, activity, cancellationToken); + await ExecuteTaskInternalAsync(scope.ServiceProvider, cancellationToken); Logger.LogInformation("BackgroundService execute end"); if (_executeCounter.Enabled) _executeCounter.Add(1, new KeyValuePair("status", "0")); } diff --git a/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs b/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs index add773b8..712f993c 100644 --- a/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs +++ b/src/WeihanLi.Common/Helpers/Hosting/TimerBaseBackgroundService.cs @@ -40,7 +40,7 @@ protected TimerBaseBackgroundServiceWithDiagnostic(IServiceProvider serviceProvi protected ILogger Logger { get; } - protected abstract Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, Activity? activity, CancellationToken cancellationToken); + protected abstract Task ExecuteTaskInternalAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken); protected override async Task ExecuteTaskAsync(CancellationToken cancellationToken) { @@ -49,7 +49,7 @@ protected override async Task ExecuteTaskAsync(CancellationToken cancellationTok try { Logger.LogInformation("BackgroundService execute begin"); - await ExecuteTaskInternalAsync(scope.ServiceProvider, activity, cancellationToken); + await ExecuteTaskInternalAsync(scope.ServiceProvider, cancellationToken); Logger.LogInformation("BackgroundService execute end"); if (_executeCounter.Enabled) _executeCounter.Add(1, new KeyValuePair("status", "0")); } From 33ab0f36fcaa7cc4701d58745e506bcfbb63c89e Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Wed, 25 Oct 2023 22:01:32 +0800 Subject: [PATCH 09/13] refactor: use Guard.NotNull for null check --- .../AspectCoreProxyFactory.cs | 15 +++++---------- .../AspectCoreProxyTypeFactory.cs | 16 ++++------------ .../FluentAspectBuilderExtensions.cs | 10 ++-------- .../CastleProxyFactory.cs | 17 +++++------------ .../CastleProxyTypeFactory.cs | 15 +++------------ .../FluentAspectBuilderExtensions.cs | 10 ++-------- .../SerilogLogger.cs | 2 +- .../SerilogLoggerExtensions.cs | 5 ++--- .../SerilogLoggerProvider.cs | 5 +---- src/WeihanLi.Data/SqlExtensions.cs | 2 ++ 10 files changed, 27 insertions(+), 70 deletions(-) diff --git a/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyFactory.cs b/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyFactory.cs index 5c796d57..a8c0a9f2 100644 --- a/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyFactory.cs +++ b/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyFactory.cs @@ -15,8 +15,7 @@ public AspectCoreProxyFactory(IServiceProvider serviceProvider) public object CreateProxy(Type serviceType, object?[] arguments) { - if (null == serviceType) - throw new ArgumentNullException(nameof(serviceType)); + Guard.NotNull(serviceType); if (serviceType.IsInterface) return AspectCoreHelper.ProxyGenerator.CreateInterfaceProxy(serviceType); @@ -27,10 +26,8 @@ public object CreateProxy(Type serviceType, object?[] arguments) public object CreateProxy(Type serviceType, Type implementType, params object?[] arguments) { - if (null == serviceType) - throw new ArgumentNullException(nameof(serviceType)); - if (null == implementType) - throw new ArgumentNullException(nameof(implementType)); + Guard.NotNull(serviceType); + Guard.NotNull(implementType); if (serviceType.IsInterface) { @@ -43,10 +40,8 @@ public object CreateProxy(Type serviceType, Type implementType, params object?[] public object CreateProxyWithTarget(Type serviceType, object implement, object?[] arguments) { - if (null == serviceType) - throw new ArgumentNullException(nameof(serviceType)); - if (null == implement) - throw new ArgumentNullException(nameof(implement)); + Guard.NotNull(serviceType); + Guard.NotNull(implement); if (serviceType.IsInterface) return AspectCoreHelper.ProxyGenerator.CreateInterfaceProxy(serviceType, implement); diff --git a/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyTypeFactory.cs b/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyTypeFactory.cs index ff1ab7f5..d8e39087 100644 --- a/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyTypeFactory.cs +++ b/src/WeihanLi.Common.Aspect.AspectCore/AspectCoreProxyTypeFactory.cs @@ -4,10 +4,7 @@ internal sealed class AspectCoreProxyTypeFactory : IProxyTypeFactory { public Type CreateProxyType(Type serviceType) { - if (null == serviceType) - { - throw new ArgumentNullException(nameof(serviceType)); - } + Guard.NotNull(serviceType); if (serviceType.IsInterface) { @@ -19,14 +16,9 @@ public Type CreateProxyType(Type serviceType) public Type CreateProxyType(Type serviceType, Type implementType) { - if (null == serviceType) - { - throw new ArgumentNullException(nameof(serviceType)); - } - if (null == implementType) - { - throw new ArgumentNullException(nameof(implementType)); - } + Guard.NotNull(serviceType); + Guard.NotNull(implementType); + if (serviceType.IsInterface) { return AspectCoreHelper.ProxyGenerator.TypeGenerator.CreateClassProxyType(serviceType, implementType); diff --git a/src/WeihanLi.Common.Aspect.AspectCore/FluentAspectBuilderExtensions.cs b/src/WeihanLi.Common.Aspect.AspectCore/FluentAspectBuilderExtensions.cs index cca86f00..421aadc8 100644 --- a/src/WeihanLi.Common.Aspect.AspectCore/FluentAspectBuilderExtensions.cs +++ b/src/WeihanLi.Common.Aspect.AspectCore/FluentAspectBuilderExtensions.cs @@ -7,10 +7,7 @@ public static class FluentAspectBuilderExtensions { public static IFluentAspectsBuilder UseAspectCoreProxy(this IFluentAspectsBuilder builder) { - if (builder is null) - { - throw new ArgumentNullException(nameof(builder)); - } + Guard.NotNull(builder); builder.Services.AddTransient(); builder.Services.AddTransient(); @@ -21,10 +18,7 @@ public static IFluentAspectsBuilder UseAspectCoreProxy(this IFluentAspectsBuilde public static IFluentAspectsServiceContainerBuilder UseAspectCoreProxy(this IFluentAspectsServiceContainerBuilder builder) { - if (builder is null) - { - throw new ArgumentNullException(nameof(builder)); - } + Guard.NotNull(builder); builder.Services.AddTransient(); builder.Services.AddTransient(); diff --git a/src/WeihanLi.Common.Aspect.Castle/CastleProxyFactory.cs b/src/WeihanLi.Common.Aspect.Castle/CastleProxyFactory.cs index cc06bb4c..39e63cae 100644 --- a/src/WeihanLi.Common.Aspect.Castle/CastleProxyFactory.cs +++ b/src/WeihanLi.Common.Aspect.Castle/CastleProxyFactory.cs @@ -15,8 +15,7 @@ public CastleProxyFactory(IServiceProvider serviceProvider) public object CreateProxy(Type serviceType, object?[] arguments) { - if (null == serviceType) - throw new ArgumentNullException(nameof(serviceType)); + Guard.NotNull(serviceType); if (serviceType.IsInterface) { @@ -32,11 +31,8 @@ public object CreateProxy(Type serviceType, object?[] arguments) public object CreateProxy(Type serviceType, Type implementType, params object?[] arguments) { - if (null == serviceType) - throw new ArgumentNullException(nameof(serviceType)); - - if (null == implementType) - throw new ArgumentNullException(nameof(implementType)); + Guard.NotNull(serviceType); + Guard.NotNull(implementType); if (serviceType.IsInterface) { @@ -49,11 +45,8 @@ public object CreateProxy(Type serviceType, Type implementType, params object?[] public object CreateProxyWithTarget(Type serviceType, object implement, object?[] arguments) { - if (null == serviceType) - throw new ArgumentNullException(nameof(serviceType)); - - if (null == implement) - throw new ArgumentNullException(nameof(implement)); + Guard.NotNull(serviceType); + Guard.NotNull(implement); if (serviceType.IsInterface) { diff --git a/src/WeihanLi.Common.Aspect.Castle/CastleProxyTypeFactory.cs b/src/WeihanLi.Common.Aspect.Castle/CastleProxyTypeFactory.cs index b6ecb98c..5464e70b 100644 --- a/src/WeihanLi.Common.Aspect.Castle/CastleProxyTypeFactory.cs +++ b/src/WeihanLi.Common.Aspect.Castle/CastleProxyTypeFactory.cs @@ -4,10 +4,7 @@ internal sealed class CastleProxyTypeFactory : IProxyTypeFactory { public Type CreateProxyType(Type serviceType) { - if (null == serviceType) - { - throw new ArgumentNullException(nameof(serviceType)); - } + Guard.NotNull(serviceType); if (serviceType.IsInterface) { @@ -21,14 +18,8 @@ public Type CreateProxyType(Type serviceType) public Type CreateProxyType(Type serviceType, Type implementType) { - if (null == serviceType) - { - throw new ArgumentNullException(nameof(serviceType)); - } - if (null == implementType) - { - throw new ArgumentNullException(nameof(implementType)); - } + Guard.NotNull(serviceType); + Guard.NotNull(implementType); if (serviceType.IsInterface) { diff --git a/src/WeihanLi.Common.Aspect.Castle/FluentAspectBuilderExtensions.cs b/src/WeihanLi.Common.Aspect.Castle/FluentAspectBuilderExtensions.cs index 553c5c2c..19274530 100644 --- a/src/WeihanLi.Common.Aspect.Castle/FluentAspectBuilderExtensions.cs +++ b/src/WeihanLi.Common.Aspect.Castle/FluentAspectBuilderExtensions.cs @@ -7,10 +7,7 @@ public static class FluentAspectBuilderExtensions { public static IFluentAspectsBuilder UseCastleProxy(this IFluentAspectsBuilder builder) { - if (builder is null) - { - throw new ArgumentNullException(nameof(builder)); - } + Guard.NotNull(builder); builder.Services.AddTransient(); builder.Services.AddTransient(); @@ -22,10 +19,7 @@ public static IFluentAspectsBuilder UseCastleProxy(this IFluentAspectsBuilder bu public static IFluentAspectsServiceContainerBuilder UseCastleProxy(this IFluentAspectsServiceContainerBuilder builder) { - if (builder is null) - { - throw new ArgumentNullException(nameof(builder)); - } + Guard.NotNull(builder); builder.Services.AddTransient(); builder.Services.AddTransient(); diff --git a/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs b/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs index cae0777f..4fa68574 100644 --- a/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs +++ b/src/WeihanLi.Common.Logging.Serilog/SerilogLogger.cs @@ -23,7 +23,7 @@ public SerilogLogger( ILogger? logger = null, string? name = null) { - _provider = provider ?? throw new ArgumentNullException(nameof(provider)); + _provider = WeihanLi.Common.Guard.NotNull(provider); // If a logger was passed, the provider has already added itself as an enricher _logger = logger ?? Serilog.Log.Logger.ForContext(new[] { provider }); diff --git a/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerExtensions.cs b/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerExtensions.cs index b992831c..a0a8776f 100644 --- a/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerExtensions.cs +++ b/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerExtensions.cs @@ -22,7 +22,7 @@ public static ILoggerFactory AddSerilog( ILogger? logger = null, bool dispose = false) { - if (factory == null) throw new ArgumentNullException(nameof(factory)); + Guard.NotNull(factory); factory.AddProvider(new SerilogLoggerProvider(logger, dispose)); @@ -40,8 +40,7 @@ public static ILoggerFactory AddSerilog( /// The logging builder. public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, ILogger? logger = null, bool dispose = false) { - if (builder == null) - throw new ArgumentNullException(nameof(builder)); + Guard.NotNull(builder); if (dispose) { diff --git a/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerProvider.cs b/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerProvider.cs index 9b3b6274..0b54f20b 100644 --- a/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerProvider.cs +++ b/src/WeihanLi.Common.Logging.Serilog/SerilogLoggerProvider.cs @@ -50,10 +50,7 @@ public FrameworkLogger CreateLogger(string categoryName) public IDisposable BeginScope(T state) { - if (state == null) - { - throw new ArgumentNullException(nameof(state)); - } + WeihanLi.Common.Guard.NotNull(state); if (CurrentScope != null) return new SerilogLoggerScope(this, state); diff --git a/src/WeihanLi.Data/SqlExtensions.cs b/src/WeihanLi.Data/SqlExtensions.cs index 4349e585..5054b5a4 100644 --- a/src/WeihanLi.Data/SqlExtensions.cs +++ b/src/WeihanLi.Data/SqlExtensions.cs @@ -94,6 +94,7 @@ public static int BulkCopy(this SqlConnection conn, IReadOnlyCollection? l /// public static int BulkCopy(this SqlConnection conn, DataTable dataTable, string destinationTableName, int batchSize, IDictionary? columnMappings, int bulkCopyTimeout = 60) { + Guard.NotNull(conn); conn.EnsureOpen(); using var bulkCopy = new SqlBulkCopy(conn); if (null == columnMappings) @@ -175,6 +176,7 @@ public static async Task BulkCopyAsync(this SqlConnection conn, IReadOnl /// public static async Task BulkCopyAsync(this SqlConnection conn, DataTable dataTable, string destinationTableName, int batchSize, IDictionary? columnMappings, int bulkCopyTimeout = 60) { + Guard.NotNull(conn); await conn.EnsureOpenAsync(); using var bulkCopy = new SqlBulkCopy(conn); if (null == columnMappings) From bf474736a134208c1e62c50d41e910aca7a5baf2 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 31 Oct 2023 00:15:23 +0800 Subject: [PATCH 10/13] refactor: internal IPNetwork --- Directory.Build.props | 4 ++++ build.cake | 4 ++-- build/sign.props | 2 +- src/WeihanLi.Common/Helpers/NetHelper.cs | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1ac00e34..9be2fa92 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,4 +12,8 @@ $(MSBuildThisFileDirectory)artifacts true + + + + diff --git a/build.cake b/build.cake index 22e7146b..69e8a108 100644 --- a/build.cake +++ b/build.cake @@ -3,7 +3,7 @@ /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); -var configuration = Argument("configuration", "Release"); +var configuration = Argument("configuration", "Debug"); var stable = Argument("stable", "false"); var branchName = EnvironmentVariable("BUILD_SOURCEBRANCHNAME") ?? "local"; @@ -102,7 +102,7 @@ Task("pack") { var settings = new DotNetPackSettings { - Configuration = configuration, + Configuration = "Release", OutputDirectory = artifacts, VersionSuffix = "", NoRestore = true, diff --git a/build/sign.props b/build/sign.props index 28995a22..1f01b027 100644 --- a/build/sign.props +++ b/build/sign.props @@ -1,5 +1,5 @@ - + True $(MSBuildThisFileDirectory)weihanli.snk False diff --git a/src/WeihanLi.Common/Helpers/NetHelper.cs b/src/WeihanLi.Common/Helpers/NetHelper.cs index 9db20253..a0e0af36 100644 --- a/src/WeihanLi.Common/Helpers/NetHelper.cs +++ b/src/WeihanLi.Common/Helpers/NetHelper.cs @@ -7,7 +7,7 @@ namespace WeihanLi.Common.Helpers; /// IPNetwork /// https://source.dot.net/#Microsoft.AspNetCore.HttpOverrides/IPNetwork.cs,ab4d458482303384 /// -public class IPNetwork +internal sealed class IPNetwork { public IPNetwork(string cidr) { From 53858dce3c36c61403cd07827bc7bf5cc743954a Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 31 Oct 2023 08:36:14 +0800 Subject: [PATCH 11/13] ci: fix failed CI --- Directory.Build.props | 2 +- build.cake | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9be2fa92..a754e6ba 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,6 +14,6 @@ - + diff --git a/build.cake b/build.cake index 69e8a108..9f904019 100644 --- a/build.cake +++ b/build.cake @@ -3,7 +3,7 @@ /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); -var configuration = Argument("configuration", "Debug"); +var configuration = Argument("configuration", "Release"); var stable = Argument("stable", "false"); var branchName = EnvironmentVariable("BUILD_SOURCEBRANCHNAME") ?? "local"; @@ -68,7 +68,8 @@ Task("build") .IsDependentOn("restore") .Does(() => { - var buildSetting = new DotNetBuildSettings{ + var buildSetting = new DotNetBuildSettings + { NoRestore = true, Configuration = configuration }; @@ -87,7 +88,7 @@ Task("test") var testSettings = new DotNetTestSettings { NoRestore = false, - Configuration = configuration + Configuration = "Debug" }; foreach(var project in testProjects) { From aff064484c21fc45b9197c5e4233abe05a3e6b85 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 31 Oct 2023 08:55:15 +0800 Subject: [PATCH 12/13] refactor: update ValueTask usage --- Directory.Packages.props | 1 + src/WeihanLi.Common/Aspect/AspectDelegate.cs | 5 -- .../Extensions/DumpExtension.cs | 25 ++++---- .../Extensions/FuncExtension.cs | 60 +++++++++---------- .../Extensions/TaskExtension.cs | 2 - src/WeihanLi.Common/Guard.cs | 2 - .../Helpers/DisposableHelper.cs | 39 ++++-------- .../Helpers/PipelineBuilder.cs | 6 +- .../Pipelines/PipelineBuilderExtensions.cs | 4 -- .../Helpers/Pipelines/PipelineMiddleware.cs | 5 -- .../Pipelines/ValueAsyncPipelineBuilder.cs | 2 - src/WeihanLi.Common/Helpers/TaskHelper.cs | 4 +- src/WeihanLi.Common/WeihanLi.Common.csproj | 4 +- 13 files changed, 57 insertions(+), 102 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5d0f9f7a..add937f0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,6 +14,7 @@ + diff --git a/src/WeihanLi.Common/Aspect/AspectDelegate.cs b/src/WeihanLi.Common/Aspect/AspectDelegate.cs index e317459a..83688939 100644 --- a/src/WeihanLi.Common/Aspect/AspectDelegate.cs +++ b/src/WeihanLi.Common/Aspect/AspectDelegate.cs @@ -69,7 +69,6 @@ public static void InvokeInternal(IInvocation invocation, IReadOnlyList GetAspectDelegate(IInvocation invocation, { return task; } - -#if ValueTaskSupport if (invocation.ReturnValue is ValueTask valTask) { return valTask.AsTask(); } -#endif return Task.CompletedTask; }; diff --git a/src/WeihanLi.Common/Extensions/DumpExtension.cs b/src/WeihanLi.Common/Extensions/DumpExtension.cs index e24aa230..b045d921 100644 --- a/src/WeihanLi.Common/Extensions/DumpExtension.cs +++ b/src/WeihanLi.Common/Extensions/DumpExtension.cs @@ -33,18 +33,15 @@ public static Task DumpAsync(this T t, Func dumpAction, Func(this T t, Func dumpAction) - { - return Guard.NotNull(dumpAction, nameof(dumpAction)) - .Invoke(t is null ? NullValue : t.ToJsonOrString()); - } - - public static ValueTask DumpAsync(this T t, Func dumpAction, Func dumpValueFactory) - { - return Guard.NotNull(dumpAction, nameof(dumpAction)) - .Invoke(Guard.NotNull(dumpValueFactory, nameof(dumpValueFactory)).Invoke(t)); - } -#endif + public static ValueTask DumpAsync(this T t, Func dumpAction) + { + return Guard.NotNull(dumpAction, nameof(dumpAction)) + .Invoke(t is null ? NullValue : t.ToJsonOrString()); + } + + public static ValueTask DumpAsync(this T t, Func dumpAction, Func dumpValueFactory) + { + return Guard.NotNull(dumpAction, nameof(dumpAction)) + .Invoke(Guard.NotNull(dumpValueFactory, nameof(dumpValueFactory)).Invoke(t)); + } } diff --git a/src/WeihanLi.Common/Extensions/FuncExtension.cs b/src/WeihanLi.Common/Extensions/FuncExtension.cs index 0286b540..577d0a46 100644 --- a/src/WeihanLi.Common/Extensions/FuncExtension.cs +++ b/src/WeihanLi.Common/Extensions/FuncExtension.cs @@ -50,45 +50,41 @@ public static Func WrapTask(this Action WrapValueTask(this Action action) + public static Func WrapValueTask(this Action action) + { + return (t) => { - return (t) => - { - action.Invoke(t); - return default; - }; - } + action.Invoke(t); + return default; + }; + } - public static Func WrapValueTask(this Action action) + public static Func WrapValueTask(this Action action) + { + return (t1, t2) => { - return (t1, t2) => - { - action.Invoke(t1, t2); - return default; - }; - } + action.Invoke(t1, t2); + return default; + }; + } - public static Func WrapValueTask(this Action action) + public static Func WrapValueTask(this Action action) + { + return (t1, t2, t3) => { - return (t1, t2, t3) => - { - action.Invoke(t1, t2, t3); - return default; - }; - } + action.Invoke(t1, t2, t3); + return default; + }; + } - public static Func WrapValueTask(this Action action) + public static Func WrapValueTask(this Action action) + { + return (t1, t2, t3, t4) => { - return (t1, t2, t3, t4) => - { - action.Invoke(t1, t2, t3, t4); - return default; - }; - } - -#endif + action.Invoke(t1, t2, t3, t4); + return default; + }; + } public static Func WrapCancellation(this Func func) => _ => Guard.NotNull(func, nameof(func)).Invoke(); diff --git a/src/WeihanLi.Common/Extensions/TaskExtension.cs b/src/WeihanLi.Common/Extensions/TaskExtension.cs index ebc9eadf..4651c99a 100644 --- a/src/WeihanLi.Common/Extensions/TaskExtension.cs +++ b/src/WeihanLi.Common/Extensions/TaskExtension.cs @@ -8,9 +8,7 @@ public static class TaskExtension { public static Task WrapTask(this T t) => Task.FromResult(t); -#if ValueTaskSupport public static ValueTask WrapValueTask(this T t) => new ValueTask(t); -#endif public static Task AsTask(this CancellationToken cancellationToken) { diff --git a/src/WeihanLi.Common/Guard.cs b/src/WeihanLi.Common/Guard.cs index 13cf96e9..59da9c20 100644 --- a/src/WeihanLi.Common/Guard.cs +++ b/src/WeihanLi.Common/Guard.cs @@ -85,7 +85,6 @@ public static async Task EnsureAsync(Func> condition, T t, [ return t; } -#if ValueTaskSupport public static async Task EnsureAsync(Func> condition, T t, [CallerArgumentExpression(nameof(t))] string? paramName = null) { NotNull(condition); @@ -95,5 +94,4 @@ public static async Task EnsureAsync(Func> condition, T } return t; } -#endif } diff --git a/src/WeihanLi.Common/Helpers/DisposableHelper.cs b/src/WeihanLi.Common/Helpers/DisposableHelper.cs index 0bd8bed3..53ff12a0 100644 --- a/src/WeihanLi.Common/Helpers/DisposableHelper.cs +++ b/src/WeihanLi.Common/Helpers/DisposableHelper.cs @@ -3,10 +3,7 @@ /// /// A singleton disposable that does nothing when disposed. /// -public sealed class NullDisposable : IDisposable -#if ValueTaskSupport - , IAsyncDisposable -#endif +public sealed class NullDisposable : IDisposable, IAsyncDisposable { private NullDisposable() { @@ -16,15 +13,13 @@ public void Dispose() { } -#if ValueTaskSupport - public ValueTask DisposeAsync() => + public ValueTask DisposeAsync() => #if NET6_0_OR_GREATER ValueTask.CompletedTask #else default -#endif - ; #endif + ; /// /// Gets the instance of . @@ -32,10 +27,7 @@ public ValueTask DisposeAsync() => public static NullDisposable Instance { get; } = new(); } -public sealed class DisposableAction : IDisposable -#if ValueTaskSupport - , IAsyncDisposable -#endif +public sealed class DisposableAction : IDisposable, IAsyncDisposable { public static readonly DisposableAction Empty = new(null); @@ -51,7 +43,6 @@ public void Dispose() Interlocked.Exchange(ref _disposeAction, null)?.Invoke(); } -#if ValueTaskSupport public ValueTask DisposeAsync() { Dispose(); @@ -59,11 +50,10 @@ public ValueTask DisposeAsync() #if NET6_0_OR_GREATER ValueTask.CompletedTask #else - default + default #endif - ; + ; } -#endif } /// @@ -72,10 +62,7 @@ public ValueTask DisposeAsync() /// https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync /// https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync#implement-both-dispose-and-async-dispose-patterns /// -public class DisposableBase : IDisposable -#if ValueTaskSupport - , IAsyncDisposable -#endif +public class DisposableBase : IDisposable, IAsyncDisposable { // To detect redundant calls private bool _disposed; @@ -86,7 +73,7 @@ public void Dispose() Dispose(disposing: true); GC.SuppressFinalize(this); } -#if ValueTaskSupport + public async ValueTask DisposeAsync() { if (_disposed) return; @@ -97,7 +84,7 @@ public async ValueTask DisposeAsync() // Suppress finalization. GC.SuppressFinalize(this); } -#endif + protected virtual void Dispose(bool disposing) { if (disposing) @@ -110,18 +97,16 @@ protected virtual void Dispose(bool disposing) _disposed = true; } -#if ValueTaskSupport protected virtual ValueTask DisposeAsyncCore() { return #if NET6_0_OR_GREATER - ValueTask.CompletedTask + ValueTask.CompletedTask #else - default + default #endif - ; + ; } -#endif ~DisposableBase() => Dispose(false); } diff --git a/src/WeihanLi.Common/Helpers/PipelineBuilder.cs b/src/WeihanLi.Common/Helpers/PipelineBuilder.cs index 4486e276..dd62f3ac 100644 --- a/src/WeihanLi.Common/Helpers/PipelineBuilder.cs +++ b/src/WeihanLi.Common/Helpers/PipelineBuilder.cs @@ -25,14 +25,13 @@ public static IAsyncPipelineBuilder CreateAsync(Func(completeFunc); } -#if ValueTaskSupport public static IValueAsyncPipelineBuilder CreateValueAsync() { return new ValueAsyncPipelineBuilder(c => #if NET6_0_OR_GREATER - ValueTask.CompletedTask + ValueTask.CompletedTask #else - default(ValueTask) + default #endif ); } @@ -40,5 +39,4 @@ public static IValueAsyncPipelineBuilder CreateValueAsync(Fu { return new ValueAsyncPipelineBuilder(completeFunc); } -#endif } diff --git a/src/WeihanLi.Common/Helpers/Pipelines/PipelineBuilderExtensions.cs b/src/WeihanLi.Common/Helpers/Pipelines/PipelineBuilderExtensions.cs index 36fbacee..11ce8a4a 100644 --- a/src/WeihanLi.Common/Helpers/Pipelines/PipelineBuilderExtensions.cs +++ b/src/WeihanLi.Common/Helpers/Pipelines/PipelineBuilderExtensions.cs @@ -169,8 +169,6 @@ public static IAsyncPipelineBuilder Run(this IAsyncPipelineB } #endregion IAsyncPipelineBuilder -#if ValueTaskSupport - #region IValueAsyncPipelineBuilder public static IValueAsyncPipelineBuilder Use(this IValueAsyncPipelineBuilder builder, @@ -249,6 +247,4 @@ public static IValueAsyncPipelineBuilder Run(this IValueAsyn } #endregion IValueAsyncPipelineBuilder - -#endif } diff --git a/src/WeihanLi.Common/Helpers/Pipelines/PipelineMiddleware.cs b/src/WeihanLi.Common/Helpers/Pipelines/PipelineMiddleware.cs index b7286edf..4ca7e1ad 100644 --- a/src/WeihanLi.Common/Helpers/Pipelines/PipelineMiddleware.cs +++ b/src/WeihanLi.Common/Helpers/Pipelines/PipelineMiddleware.cs @@ -14,12 +14,7 @@ public interface IAsyncPipelineMiddleware Task InvokeAsync(TContext context, Func next); } -#if ValueTaskSupport - public interface IValueAsyncPipelineMiddleware { ValueTask InvokeAsync(TContext context, Func next); } - -#endif - diff --git a/src/WeihanLi.Common/Helpers/Pipelines/ValueAsyncPipelineBuilder.cs b/src/WeihanLi.Common/Helpers/Pipelines/ValueAsyncPipelineBuilder.cs index 831a567c..8a98573a 100644 --- a/src/WeihanLi.Common/Helpers/Pipelines/ValueAsyncPipelineBuilder.cs +++ b/src/WeihanLi.Common/Helpers/Pipelines/ValueAsyncPipelineBuilder.cs @@ -1,7 +1,6 @@ // Copyright (c) Weihan Li. All rights reserved. // Licensed under the Apache license. -#if ValueTaskSupport using WeihanLi.Common.Abstractions; // ReSharper disable once CheckNamespace @@ -44,4 +43,3 @@ public Func Build() public IValueAsyncPipelineBuilder New() => new ValueAsyncPipelineBuilder(_completeFunc); } -#endif diff --git a/src/WeihanLi.Common/Helpers/TaskHelper.cs b/src/WeihanLi.Common/Helpers/TaskHelper.cs index 95ad6a4a..ed2bbddc 100644 --- a/src/WeihanLi.Common/Helpers/TaskHelper.cs +++ b/src/WeihanLi.Common/Helpers/TaskHelper.cs @@ -4,8 +4,7 @@ namespace WeihanLi.Common.Helpers; public static class TaskHelper -{ -#if ValueTaskSupport +{ public static ValueTask ToTask(object? obj) { var task = obj switch @@ -21,5 +20,4 @@ public static ValueTask ToTask(object? obj) }; return task; } -#endif } diff --git a/src/WeihanLi.Common/WeihanLi.Common.csproj b/src/WeihanLi.Common/WeihanLi.Common.csproj index b7794254..ea888ffc 100644 --- a/src/WeihanLi.Common/WeihanLi.Common.csproj +++ b/src/WeihanLi.Common/WeihanLi.Common.csproj @@ -1,12 +1,12 @@  - true - $(DefineConstants);ValueTaskSupport + true true + From 0f0c71c6cc8b39f22267434ba2964215bd9290f7 Mon Sep 17 00:00:00 2001 From: Weihan Li Date: Tue, 31 Oct 2023 08:58:17 +0800 Subject: [PATCH 13/13] feat: downgrade Microsoft.Bcl.AsyncInterfaces version --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index add937f0..0eeae2fb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,7 +14,7 @@ - +