Skip to content

Commit 8a467ff

Browse files
chore: Update to .NET 10 (#372)
This pull request upgrades the project to .NET 10 and updates related dependencies and configurations throughout the codebase. The changes ensure compatibility with the latest .NET SDK, update package versions, and code analysis settings. **.NET 10 Upgrade:** * Updated the target framework to `net10.0` in all relevant `.csproj` files to migrate the project from .NET 9 to .NET 10. * Changed the SDK version in `global.json` to `10.0.100` to use the .NET 10 SDK. * Updated the GitHub Actions workflow to use `actions/setup-dotnet@v4` and reference `global.json` for SDK installation. **Dependency Updates:** * Bumped versions of key NuGet packages, including `Microsoft.Extensions.DependencyInjection`, `Microsoft.Extensions.Logging`, and test-related packages, to their .NET 10-compatible releases in `Directory.Packages.props`. **Configuration and Code Analysis Improvements:** * Increased the code analysis level to `10.0` in `DotNetAnalyzers.props` for enhanced static analysis. * Added a new analyzer rule configuration for `CA1873` to `.editorconfig` to suggest avoiding expensive argument evaluation when logging is disabled. **Documentation and Versioning:** * Updated the tool version references in `README.md` and bumped the project version to `4.0-beta.{height}` in `version.json` to reflect the major upgrade.
1 parent 9d40c41 commit 8a467ff

File tree

10 files changed

+17
-14
lines changed

10 files changed

+17
-14
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ dotnet_diagnostic.CA1014.severity = none
4545
# CA1031: Do not catch general exception types
4646
dotnet_diagnostic.CA1031.severity = suggestion
4747

48+
# CA1873: Evaluation of this argument may be expensive and unnecessary if logging is disabled
49+
dotnet_diagnostic.CA1873.severity = suggestion
50+
4851
# IDE0008: Use explicit type instead of var
4952
dotnet_diagnostic.IDE0008.severity = error
5053

.github/actions/install-tools/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ runs:
44
using: "composite"
55
steps:
66
- name: Setup .NET
7-
uses: actions/setup-dotnet@v3
7+
uses: actions/setup-dotnet@v4
88
with:
9-
dotnet-version: 9.x
9+
global-json-file: global.json
1010

1111
- name: Install .NET tools
1212
shell: pwsh

Directory.Packages.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
<ItemGroup>
2626
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
2727
<PackageVersion Include="DotNetConfig" Version="1.2.0" />
28-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.10" />
29-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.10" />
30-
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="9.0.10" />
28+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
29+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
30+
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0" />
3131
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.242" />
3232
<PackageVersion Include="Serilog" Version="4.3.0" />
3333
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.2" />
@@ -41,8 +41,8 @@
4141
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
4242
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
4343
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
44-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
45-
<PackageVersion Include="Neovolve.Logging.Xunit.v3" Version="7.1.0" />
44+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
45+
<PackageVersion Include="Neovolve.Logging.Xunit.v3" Version="7.2.0" />
4646
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="$(SystemIOAbstractionsVersion)" />
4747
<PackageVersion Include="xunit.analyzers" Version="1.25.0" />
4848
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dotnet tool uninstall -g StartMenuCleaner
6767

6868
``` shell
6969
> Clean-StartMenu --help
70-
StartMenuCleaner 2.0.0
70+
StartMenuCleaner 4.0.0
7171
Copyright (C) 2021 Craig Treasure
7272

7373
-d, --debug Enable debug information in console.

eng/DotNetAnalyzers.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
99
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
1010
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
11-
<AnalysisLevel>9.0</AnalysisLevel>
11+
<AnalysisLevel>10.0</AnalysisLevel>
1212
</PropertyGroup>
1313

1414
</Project>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.306",
3+
"version": "10.0.100",
44
"allowPrerelease": false,
55
"rollForward": "latestPatch"
66
}

src/StartMenuCleaner/StartMenuCleaner.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net9.0</TargetFramework>
5+
<TargetFramework>net10.0</TargetFramework>
66

77
<PackAsTool>True</PackAsTool>
88
<ToolCommandName>Clean-StartMenu</ToolCommandName>

test/StartMenuCleaner.TestLibrary/StartMenuCleaner.TestLibrary.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55

66
<IsTestProject>false</IsTestProject>
77
</PropertyGroup>

test/StartMenuCleaner.Tests/StartMenuCleaner.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<OutputType>Exe</OutputType>
66
</PropertyGroup>
77

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "3.0-beta.{height}",
3+
"version": "4.0-beta.{height}",
44
"buildNumberOffset": -1,
55
"nugetPackageVersion": {
66
"semVer": 2

0 commit comments

Comments
 (0)