Skip to content

Commit e61a651

Browse files
authored
Merge pull request #1401 from autofac/feature/net8
Update build/target frameworks for .NET 8; remove netcoreapp3.1.
2 parents 5af8326 + 7a25198 commit e61a651

33 files changed

+92
-147
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"recommendations": [
3-
"formulahendry.dotnet-test-explorer",
4-
"ms-dotnettools.csharp",
3+
"ms-dotnettools.csdevkit",
54
"editorconfig.editorconfig",
65
"davidanson.vscode-markdownlint"
76
]

.vscode/settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88
"diagnoser",
99
"inheritdoc",
1010
"langword",
11+
"netcoreapp",
1112
"netstandard",
1213
"notnull",
1314
"paramref",
1415
"startable",
1516
"subclassing",
1617
"typeparam",
18+
"unconfigured",
1719
"xunit"
1820
],
19-
"dotnet-test-explorer.testProjectPath": "test/**/*Test.csproj",
2021
"dotnet.defaultSolution": "Autofac.sln",
2122
"explorer.fileNesting.enabled": true,
2223
"explorer.fileNesting.patterns": {
2324
"*.resx": "$(capture).*.resx, $(capture).designer.cs, $(capture).designer.vb"
2425
},
25-
"omnisharp.enableEditorConfigSupport": true,
26-
"omnisharp.enableRoslynAnalyzers": true
26+
"omnisharp.enableEditorConfigSupport": true
2727
}

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
image: Ubuntu
22

3-
version: "7.1.0.{build}"
3+
version: "8.0.0.{build}"
44

55
dotnet_csproj:
6-
version_prefix: "7.1.0"
6+
version_prefix: "8.0.0"
77
patch: true
88
file: 'src\**\*.csproj'
99

bench/Autofac.BenchmarkProfiling/Autofac.BenchmarkProfiling.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
11+
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

bench/Autofac.Benchmarks/Autofac.Benchmarks.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
38-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
39-
<PackageReference Include="xunit" Version="2.4.2" />
40-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
37+
<PackageReference Include="BenchmarkDotNet" Version="0.13.10" />
38+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
39+
<PackageReference Include="xunit" Version="2.6.1" />
40+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
4141
<PrivateAssets>all</PrivateAssets>
4242
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
4343
</PackageReference>

bench/Autofac.Benchmarks/ConcurrencyBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public async Task MultipleResolvesOnMultipleTasks()
4545
}
4646
catch (Exception ex)
4747
{
48-
Assert.True(false, ex.ToString());
48+
Assert.Fail(ex.ToString());
4949
}
5050
});
5151
tasks.Add(task);

bench/Autofac.Benchmarks/ConcurrencyNestedScopeBenchmark.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public async Task MultipleResolvesOnMultipleTasks()
5555
}
5656
catch (Exception ex)
5757
{
58-
Assert.True(false, ex.ToString());
58+
Assert.Fail(ex.ToString());
5959
}
6060
});
6161
tasks.Add(task);

build/Analyzers.ruleset

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44
<Rules AnalyzerId="Microsoft.Usage" RuleNamespace="Microsoft.Usage">
55
<!-- Implement standard exception constructors - not all of the exception constructors (e.g., parameterless) are desired in our system. -->
66
<Rule Id="CA1032" Action="None" />
7+
<!-- Use ArgumentNullException.ThrowIfNull - this isn't available until we stop targeting netstandard. -->
8+
<Rule Id="CA1510" Action="None" />
9+
<!-- Use ArgumentOutOfRangeException.ThrowIfNegative - this isn't available until we stop targeting anything below net8.0. -->
10+
<Rule Id="CA1512" Action="None" />
11+
<!-- Use ObjectDisposedException.ThrowIf - this isn't available until we stop targeting anything below net8.0. -->
12+
<Rule Id="CA1513" Action="None" />
713
<!-- Change names to avoid reserved word overlaps (e.g., Delegate, GetType, etc.) - too many of these in the public API, we'd break if we fixed it. -->
814
<Rule Id="CA1716" Action="None" />
15+
<!-- Cache a CompositeFormat object for use in String.Format - this isn't available until we stop targeting netstandard, and we only String.Format when throwing exceptions so the work/complexity isn't justified to increase perf just for those situations. -->
16+
<Rule Id="CA1863" Action="None" />
917
<!-- Implement serialization constructors - false positive when building .NET Core -->
1018
<Rule Id="CA2229" Action="None" />
1119
<!-- Mark ISerializable types with SerializableAttribute - false positive when building .NET Core -->

codegen/Autofac.CodeGen/Autofac.CodeGen.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
1313
<ImplicitUsings>enable</ImplicitUsings>
1414
<GenerateDocumentationFile>true</GenerateDocumentationFile>
15+
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1516
</PropertyGroup>
1617

1718
<ItemGroup>
@@ -23,8 +24,8 @@
2324
</ItemGroup>
2425

2526
<ItemGroup>
26-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0" PrivateAssets="all" />
27-
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
27+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" PrivateAssets="all" />
28+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" PrivateAssets="all" />
2829
</ItemGroup>
2930

3031
</Project>

global.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"sdk": {
3-
"version": "7.0.203",
3+
"version": "8.0.100-rc.2.23502.2",
44
"rollForward": "latestFeature"
55
},
66

77
"additionalSdks": [
8-
"3.1.426",
9-
"6.0.408"
8+
"6.0.416",
9+
"7.0.403"
1010
]
1111
}

0 commit comments

Comments
 (0)