From c3bc21a8d290473a808ce7cabbbb7c2c94519554 Mon Sep 17 00:00:00 2001 From: Jonathan Channon Date: Sat, 16 Nov 2024 20:12:00 +0000 Subject: [PATCH] add .net9 support (#367) --- .github/workflows/dotnetcore.yml | 2 +- samples/CarterAndMVC/CarterAndMVC.csproj | 2 +- samples/CarterSample/CarterSample.csproj | 4 ++-- .../ValidatorOnlyProject/ValidatorOnlyProject.csproj | 4 ++-- src/Carter.Analyzers/Carter.Analyzers.csproj | 4 ++-- .../Carter.ResponseNegotiators.Newtonsoft.csproj | 4 ++-- src/Carter/Carter.csproj | 10 +++++----- template/Template.csproj | 2 +- template/content/CarterTemplate.csproj | 2 +- .../Carter.ResponseNegotiators.Newtonsoft.Tests.csproj | 3 ++- test/Carter.Samples.Tests/Carter.Samples.Tests.csproj | 5 +++-- .../Analyzers/CSharpPreviewAnalyzerTest.cs | 3 +-- .../CarterModuleShouldNotHaveDependenciesTests.cs | 3 +-- test/Carter.Tests/AuthorizationTests.cs | 5 ++--- test/Carter.Tests/Carter.Tests.csproj | 7 ++----- test/Directory.Build.props | 10 +++++----- 16 files changed, 33 insertions(+), 37 deletions(-) diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index cd1a0ee..c4dc6a4 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -25,7 +25,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v2 with: - dotnet-version: 8.* + dotnet-version: 9.* - name: Build Reason run: echo ${{github.ref}} and ${{github.event_name}} - name: Build with dotnet diff --git a/samples/CarterAndMVC/CarterAndMVC.csproj b/samples/CarterAndMVC/CarterAndMVC.csproj index 37dca7b..5e6d251 100644 --- a/samples/CarterAndMVC/CarterAndMVC.csproj +++ b/samples/CarterAndMVC/CarterAndMVC.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 CarterAndMVC Exe latest diff --git a/samples/CarterSample/CarterSample.csproj b/samples/CarterSample/CarterSample.csproj index 970b417..ae9a2eb 100644 --- a/samples/CarterSample/CarterSample.csproj +++ b/samples/CarterSample/CarterSample.csproj @@ -1,11 +1,11 @@  enable - net8.0 + net9.0 latest - + diff --git a/samples/ValidatorOnlyProject/ValidatorOnlyProject.csproj b/samples/ValidatorOnlyProject/ValidatorOnlyProject.csproj index c436f35..9899218 100644 --- a/samples/ValidatorOnlyProject/ValidatorOnlyProject.csproj +++ b/samples/ValidatorOnlyProject/ValidatorOnlyProject.csproj @@ -1,8 +1,8 @@  - net8.0 + net9.0 - + diff --git a/src/Carter.Analyzers/Carter.Analyzers.csproj b/src/Carter.Analyzers/Carter.Analyzers.csproj index 4a9f36d..07f3ecc 100644 --- a/src/Carter.Analyzers/Carter.Analyzers.csproj +++ b/src/Carter.Analyzers/Carter.Analyzers.csproj @@ -27,8 +27,8 @@ - - + + all diff --git a/src/Carter.ResponseNegotiators.Newtonsoft/Carter.ResponseNegotiators.Newtonsoft.csproj b/src/Carter.ResponseNegotiators.Newtonsoft/Carter.ResponseNegotiators.Newtonsoft.csproj index cf1896c..d5a6b62 100644 --- a/src/Carter.ResponseNegotiators.Newtonsoft/Carter.ResponseNegotiators.Newtonsoft.csproj +++ b/src/Carter.ResponseNegotiators.Newtonsoft/Carter.ResponseNegotiators.Newtonsoft.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 Jonathan Channon Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable. asp.net core;nancy;.net core;routing;carter @@ -21,7 +21,7 @@ - + all diff --git a/src/Carter/Carter.csproj b/src/Carter/Carter.csproj index 91aad0b..e4316e0 100644 --- a/src/Carter/Carter.csproj +++ b/src/Carter/Carter.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 Jonathan Channon Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable. asp.net core;nancy;.net core;routing;carter @@ -26,10 +26,10 @@ - - - - + + + + all diff --git a/template/Template.csproj b/template/Template.csproj index b892569..0fa2c0c 100644 --- a/template/Template.csproj +++ b/template/Template.csproj @@ -1,6 +1,6 @@  - net8.0 + net9.0 Template CarterTemplate A dotnet-new template for Carter applications. diff --git a/template/content/CarterTemplate.csproj b/template/content/CarterTemplate.csproj index 3f121a7..8da52ef 100644 --- a/template/content/CarterTemplate.csproj +++ b/template/content/CarterTemplate.csproj @@ -1,6 +1,6 @@ - net8.0 + net9.0 CarterTemplate Exe diff --git a/test/Carter.ResponseNegotiators.Newtonsoft.Tests/Carter.ResponseNegotiators.Newtonsoft.Tests.csproj b/test/Carter.ResponseNegotiators.Newtonsoft.Tests/Carter.ResponseNegotiators.Newtonsoft.Tests.csproj index 6fda458..2aa2aa8 100644 --- a/test/Carter.ResponseNegotiators.Newtonsoft.Tests/Carter.ResponseNegotiators.Newtonsoft.Tests.csproj +++ b/test/Carter.ResponseNegotiators.Newtonsoft.Tests/Carter.ResponseNegotiators.Newtonsoft.Tests.csproj @@ -2,7 +2,8 @@ - + + diff --git a/test/Carter.Samples.Tests/Carter.Samples.Tests.csproj b/test/Carter.Samples.Tests/Carter.Samples.Tests.csproj index 777f719..09254a4 100644 --- a/test/Carter.Samples.Tests/Carter.Samples.Tests.csproj +++ b/test/Carter.Samples.Tests/Carter.Samples.Tests.csproj @@ -10,7 +10,8 @@ - - + + + diff --git a/test/Carter.Tests/Analyzers/CSharpPreviewAnalyzerTest.cs b/test/Carter.Tests/Analyzers/CSharpPreviewAnalyzerTest.cs index 8bafe68..e6df168 100644 --- a/test/Carter.Tests/Analyzers/CSharpPreviewAnalyzerTest.cs +++ b/test/Carter.Tests/Analyzers/CSharpPreviewAnalyzerTest.cs @@ -6,9 +6,8 @@ namespace Carter.Tests.Analyzers; using Microsoft.CodeAnalysis.CSharp.Testing; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; -public sealed class CSharpPreviewAnalyzerTest : CSharpAnalyzerTest +public sealed class CSharpPreviewAnalyzerTest : CSharpAnalyzerTest where TAnalyzer : DiagnosticAnalyzer, new() { public CSharpPreviewAnalyzerTest(string code) diff --git a/test/Carter.Tests/Analyzers/CarterModuleShouldNotHaveDependenciesTests.cs b/test/Carter.Tests/Analyzers/CarterModuleShouldNotHaveDependenciesTests.cs index 5bbc561..a758b89 100644 --- a/test/Carter.Tests/Analyzers/CarterModuleShouldNotHaveDependenciesTests.cs +++ b/test/Carter.Tests/Analyzers/CarterModuleShouldNotHaveDependenciesTests.cs @@ -3,7 +3,6 @@ namespace Carter.Tests.Analyzers; using System.Threading.Tasks; using Carter.Analyzers; using Microsoft.CodeAnalysis.Testing; -using Microsoft.CodeAnalysis.Testing.Verifiers; using Xunit; public sealed class CarterModuleShouldNotHaveDependenciesTests @@ -346,7 +345,7 @@ public void AddRoutes(IEndpointRouteBuilder app) {} private static Task VerifyAsync(string code, DiagnosticResult? diagnosticResult = null) { - AnalyzerTest test = new CSharpPreviewAnalyzerTest(code); + AnalyzerTest test = new CSharpPreviewAnalyzerTest(code); if (diagnosticResult.HasValue) { test.ExpectedDiagnostics.Add(diagnosticResult.Value); diff --git a/test/Carter.Tests/AuthorizationTests.cs b/test/Carter.Tests/AuthorizationTests.cs index 22faa4f..94e2c23 100644 --- a/test/Carter.Tests/AuthorizationTests.cs +++ b/test/Carter.Tests/AuthorizationTests.cs @@ -119,9 +119,8 @@ private class TestAuthenticationHandler : AuthenticationHandler options, ILoggerFactory logger, - UrlEncoder encoder, - ISystemClock clock) - : base(options, logger, encoder, clock) + UrlEncoder encoder) + : base(options, logger, encoder) { } diff --git a/test/Carter.Tests/Carter.Tests.csproj b/test/Carter.Tests/Carter.Tests.csproj index 16966d6..6586a97 100644 --- a/test/Carter.Tests/Carter.Tests.csproj +++ b/test/Carter.Tests/Carter.Tests.csproj @@ -1,13 +1,10 @@  - - - - - + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 966e45b..3f29c41 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,6 +1,6 @@ - net8.0 + net9.0 true latest @@ -8,9 +8,9 @@ - - - - + + + +