Skip to content

Commit 139f554

Browse files
authored
Merge pull request #21 from autofac/feature/technology-refresh
Technology refresh: update dependencies and target frameworks
2 parents 283c325 + c27b8c1 commit 139f554

4 files changed

Lines changed: 11 additions & 16 deletions

File tree

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cSpell.words": [
3-
"Xunit"
3+
"autofac",
4+
"xunit"
45
],
56
"omnisharp.enableEditorConfigSupport": true
67
}

default.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project DefaultTargets="All" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="Current">
33
<PropertyGroup>
44
<!-- Increment the overall semantic version here. -->
5-
<Version>6.1.2</Version>
5+
<Version>7.0.0</Version>
66
<SolutionName>Autofac.Extras.AggregateService</SolutionName>
77
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
88
<ArtifactDirectory>$([System.IO.Path]::Combine($(MSBuildProjectDirectory),"artifacts"))</ArtifactDirectory>

src/Autofac.Extras.AggregateService/Autofac.Extras.AggregateService.csproj

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<Description>Dynamic aggregate service implementation generation for Autofac.</Description>
4-
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
4+
<TargetFrameworks>net10.0;net8.0;netstandard2.1;netstandard2.0</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<Nullable>enable</Nullable>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
@@ -40,19 +40,12 @@
4040
<AdditionalFiles Include="../../build/stylecop.json" Link="stylecop.json" />
4141
</ItemGroup>
4242
<ItemGroup>
43-
<PackageReference Include="Autofac" Version="6.0.0" />
44-
<PackageReference Include="Castle.Core" Version="4.4.1" />
45-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">
46-
<PrivateAssets>all</PrivateAssets>
47-
</PackageReference>
48-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
49-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
50-
<PrivateAssets>all</PrivateAssets>
51-
</PackageReference>
52-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" Condition="Exists('$(MSBuildThisFileDirectory)../../.git')">
43+
<PackageReference Include="Autofac" Version="9.1.0" />
44+
<PackageReference Include="Castle.Core" Version="5.2.1" />
45+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.300" Condition="Exists('$(MSBuildThisFileDirectory)../../.git')">
5346
<PrivateAssets>All</PrivateAssets>
5447
</PackageReference>
55-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
48+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
5649
<PrivateAssets>all</PrivateAssets>
5750
</PackageReference>
5851
</ItemGroup>

src/Autofac.Extras.AggregateService/ResolvingInterceptor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void Intercept(IInvocation invocation)
6464
}
6565

6666
return method
67-
.DeclaringType
67+
.DeclaringType?
6868
.GetProperties()
6969
.Where(prop => prop.GetGetMethod() == method)
7070
.FirstOrDefault();
@@ -159,7 +159,8 @@ private Dictionary<MethodInfo, Action<IInvocation>> SetupInvocationMap(Type inte
159159
}
160160

161161
// Methods without parameters
162-
var methodWithoutParams = GetType().GetMethod("MethodWithoutParams", BindingFlags.Instance | BindingFlags.NonPublic);
162+
var methodWithoutParams = GetType().GetMethod(nameof(MethodWithoutParams), BindingFlags.Instance | BindingFlags.NonPublic)
163+
?? throw new InvalidOperationException($"Unable to locate the {nameof(MethodWithoutParams)} method via reflection.");
163164
var methodWithoutParamsDelegate = (Action<IInvocation>)methodWithoutParams.CreateDelegate(typeof(Action<IInvocation>), this);
164165
methodMap.Add(method, methodWithoutParamsDelegate);
165166
}

0 commit comments

Comments
 (0)