From 04e4a83406e56dc4221dd57edf39b1e18aaa448b Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Wed, 27 May 2026 11:06:56 -0700 Subject: [PATCH 1/4] Technology refresh: update dependencies and target frameworks Update to Autofac 9.1.0, Castle.Core 5.2.1, and add net10.0/net8.0 target frameworks. Bump version to 7.0.0 for major dependency updates. Fix nullability warnings for newer target frameworks. --- default.proj | 2 +- .../Autofac.Extras.AggregateService.csproj | 14 +++++++------- .../ResolvingInterceptor.cs | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/default.proj b/default.proj index f4bce04..9520d9a 100644 --- a/default.proj +++ b/default.proj @@ -2,7 +2,7 @@ - 6.1.2 + 7.0.0 Autofac.Extras.AggregateService Release $([System.IO.Path]::Combine($(MSBuildProjectDirectory),"artifacts")) diff --git a/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj b/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj index 23acaa5..ab2aaf6 100644 --- a/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj +++ b/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj @@ -1,7 +1,7 @@  Dynamic aggregate service implementation generation for Autofac. - netstandard2.0;netstandard2.1 + net10.0;net8.0;netstandard2.1;netstandard2.0 latest enable true @@ -40,19 +40,19 @@ - - - + + + all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + All - + all diff --git a/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs b/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs index a769f95..79074eb 100644 --- a/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs +++ b/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs @@ -64,7 +64,7 @@ public void Intercept(IInvocation invocation) } return method - .DeclaringType + .DeclaringType? .GetProperties() .Where(prop => prop.GetGetMethod() == method) .FirstOrDefault(); @@ -159,7 +159,8 @@ private Dictionary> SetupInvocationMap(Type inte } // Methods without parameters - var methodWithoutParams = GetType().GetMethod("MethodWithoutParams", BindingFlags.Instance | BindingFlags.NonPublic); + var methodWithoutParams = GetType().GetMethod("MethodWithoutParams", BindingFlags.Instance | BindingFlags.NonPublic) + ?? throw new InvalidOperationException("Unable to locate the MethodWithoutParams method via reflection."); var methodWithoutParamsDelegate = (Action)methodWithoutParams.CreateDelegate(typeof(Action), this); methodMap.Add(method, methodWithoutParamsDelegate); } From c8cbf2ab2e3ec586aaa2f5a61150f4e36dc4a430 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Wed, 27 May 2026 13:39:22 -0700 Subject: [PATCH 2/4] Remove Microsoft.CodeAnalysis analyzer packages (included in .NET 10 SDK) --- .../Autofac.Extras.AggregateService.csproj | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj b/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj index ab2aaf6..c924c8f 100644 --- a/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj +++ b/src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj @@ -42,13 +42,6 @@ - - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - All From 54de1c8182bc3fbc92fae385831187cc9f677313 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Wed, 27 May 2026 13:50:52 -0700 Subject: [PATCH 3/4] Spelling words. --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ce3b549..f7754b1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ - "Xunit" + "autofac", + "xunit" ], "omnisharp.enableEditorConfigSupport": true } From c27b8c1bb612b7323e86c2b26d4d39fbd4633822 Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Wed, 27 May 2026 13:51:01 -0700 Subject: [PATCH 4/4] Use nameof for method reference. --- src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs b/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs index 79074eb..a2e42e3 100644 --- a/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs +++ b/src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs @@ -159,8 +159,8 @@ private Dictionary> SetupInvocationMap(Type inte } // Methods without parameters - var methodWithoutParams = GetType().GetMethod("MethodWithoutParams", BindingFlags.Instance | BindingFlags.NonPublic) - ?? throw new InvalidOperationException("Unable to locate the MethodWithoutParams method via reflection."); + var methodWithoutParams = GetType().GetMethod(nameof(MethodWithoutParams), BindingFlags.Instance | BindingFlags.NonPublic) + ?? throw new InvalidOperationException($"Unable to locate the {nameof(MethodWithoutParams)} method via reflection."); var methodWithoutParamsDelegate = (Action)methodWithoutParams.CreateDelegate(typeof(Action), this); methodMap.Add(method, methodWithoutParamsDelegate); }