diff --git a/sandbox/Benchmark/Benchmark.csproj b/sandbox/Benchmark/Benchmark.csproj
index f8e99ef0..136e05dd 100644
--- a/sandbox/Benchmark/Benchmark.csproj
+++ b/sandbox/Benchmark/Benchmark.csproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ net9.0
enable
True
enable
@@ -21,24 +21,24 @@
-
+
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
+
+
+
+
diff --git a/sandbox/Benchmark/BenchmarkNetUtilities/PayloadColumn.cs b/sandbox/Benchmark/BenchmarkNetUtilities/PayloadColumn.cs
index 79a30f5c..2d3be1b2 100644
--- a/sandbox/Benchmark/BenchmarkNetUtilities/PayloadColumn.cs
+++ b/sandbox/Benchmark/BenchmarkNetUtilities/PayloadColumn.cs
@@ -2,6 +2,7 @@
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
+using Perfolizer.Metrology;
namespace Benchmark.BenchmarkNetUtilities;
@@ -39,7 +40,7 @@ public string GetValue(Summary summary, BenchmarkCase benchmarkCase)
{
var instance = Activator.CreateInstance(benchmarkCase.Descriptor.Type);
var result = (byte[])methodInfo.Invoke(instance, null)!;
- return new SizeValue(result.LongLength).ToString(null);
+ return new SizeValue(result.LongLength).ToString();
}
else
{
diff --git a/sandbox/ClassLibrary/ClassLibrary.csproj b/sandbox/ClassLibrary/ClassLibrary.csproj
index c5177aa5..1998e142 100644
--- a/sandbox/ClassLibrary/ClassLibrary.csproj
+++ b/sandbox/ClassLibrary/ClassLibrary.csproj
@@ -1,16 +1,15 @@
- net8.0;netstandard2.1
+ net8.0;net9.0;netstandard2.1
enable
- 11.0
enable
false
-
-
+
+
Analyzer
false
diff --git a/sandbox/Net6VsNet7/Net6VsNet7.csproj b/sandbox/Net6VsNet7/Net6VsNet7.csproj
index 5b7138c2..60d6ae36 100644
--- a/sandbox/Net6VsNet7/Net6VsNet7.csproj
+++ b/sandbox/Net6VsNet7/Net6VsNet7.csproj
@@ -2,15 +2,15 @@
Exe
- net7.0;net6.0
+ net8.0;net9.0
enable
enable
false
-
-
+
+
diff --git a/sandbox/SandboxConsoleApp/SandboxConsoleApp.csproj b/sandbox/SandboxConsoleApp/SandboxConsoleApp.csproj
index a94f69d8..c90fb12f 100644
--- a/sandbox/SandboxConsoleApp/SandboxConsoleApp.csproj
+++ b/sandbox/SandboxConsoleApp/SandboxConsoleApp.csproj
@@ -2,7 +2,7 @@
Exe
- net8.0
+ net9.0
disable
enable
false
@@ -16,10 +16,11 @@
-
-
-
-
+
+
+
+
+
diff --git a/sandbox/SandboxConsoleApp/SystemTextJsonChecker.cs b/sandbox/SandboxConsoleApp/SystemTextJsonChecker.cs
index 91721d15..8264afa7 100644
--- a/sandbox/SandboxConsoleApp/SystemTextJsonChecker.cs
+++ b/sandbox/SandboxConsoleApp/SystemTextJsonChecker.cs
@@ -1,4 +1,5 @@
-using System;
+using ConsoleAppFramework;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -11,18 +12,18 @@ namespace SandboxConsoleApp;
// check the System.Text.Json's constructor select rule.
// For a class, if the only constructor is a parameterized one, that constructor will be used.
-// For a struct, or a class with multiple constructors, specify the one to use by applying the[JsonConstructor] attribute.
+// For a struct, or a class with multiple constructors, specify the one to use by applying the [JsonConstructor] attribute.
// When the attribute is not used, a public parameterless constructor is always used if present.
// MemoryPack choose class/struct as same rule.
-// If has no explicit constrtucotr, use parameterless one.
+// If has no explicit constructor, use parameterless one.
// If has a one parameterless/parameterized constructor, choose it.
-// If has multiple construcotrs, should apply [MemoryPackConstructor] attribute(no automatically choose one), otherwise generator error it.
+// If has multiple constructor, should apply [MemoryPackConstructor] attribute (no automatically choose one), otherwise generator error it.
// The parameter names of a parameterized constructor must match the property names.
// Matching is case-insensitive, and the constructor parameter must match the actual property name.
-class SystemTextJsonChecker : ConsoleAppBase
+class SystemTextJsonChecker
{
//[RootCommand]
public void JsonConstructorSelector()
@@ -57,7 +58,7 @@ public void JsonConstructorSelector()
JsonSerializer.Deserialize(seven);
}
- [RootCommand]
+ [Command("")]
public void PrivateSerialization()
{
// private field/property can not annnotate JsonInclude
diff --git a/sandbox/SandboxNet6/SandboxNet6.csproj b/sandbox/SandboxNet6/SandboxNet6.csproj
index 364f1701..372b5360 100644
--- a/sandbox/SandboxNet6/SandboxNet6.csproj
+++ b/sandbox/SandboxNet6/SandboxNet6.csproj
@@ -2,9 +2,8 @@
Exe
- net6.0
+ net9.0
enable
- 10.0
enable
false
diff --git a/sandbox/SandboxWebApp/SandboxWebApp.csproj b/sandbox/SandboxWebApp/SandboxWebApp.csproj
index dc7a8938..b9cad0c3 100644
--- a/sandbox/SandboxWebApp/SandboxWebApp.csproj
+++ b/sandbox/SandboxWebApp/SandboxWebApp.csproj
@@ -1,14 +1,14 @@
- net7.0
+ net9.0
enable
enable
false
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/MemoryPack.AspNetCoreMvcFormatter/MemoryPack.AspNetCoreMvcFormatter.csproj b/src/MemoryPack.AspNetCoreMvcFormatter/MemoryPack.AspNetCoreMvcFormatter.csproj
index 0917a7c1..75b8589e 100644
--- a/src/MemoryPack.AspNetCoreMvcFormatter/MemoryPack.AspNetCoreMvcFormatter.csproj
+++ b/src/MemoryPack.AspNetCoreMvcFormatter/MemoryPack.AspNetCoreMvcFormatter.csproj
@@ -1,7 +1,7 @@
- net7.0;net6.0
+ net8.0;net9.0
Library
enable
enable
@@ -11,7 +11,7 @@
-
+
diff --git a/src/MemoryPack.Core/MemoryPack.Core.csproj b/src/MemoryPack.Core/MemoryPack.Core.csproj
index 6e887155..05f1dc5b 100644
--- a/src/MemoryPack.Core/MemoryPack.Core.csproj
+++ b/src/MemoryPack.Core/MemoryPack.Core.csproj
@@ -1,7 +1,7 @@
- net7.0;net8.0;netstandard2.1
+ net8.0;net9.0;netstandard2.1
enable
enable
True
@@ -17,8 +17,8 @@
-
-
+
+
diff --git a/src/MemoryPack.Generator/MemoryPack.Generator.csproj b/src/MemoryPack.Generator/MemoryPack.Generator.csproj
index d6fe8a2c..9b4e5177 100644
--- a/src/MemoryPack.Generator/MemoryPack.Generator.csproj
+++ b/src/MemoryPack.Generator/MemoryPack.Generator.csproj
@@ -2,7 +2,7 @@
netstandard2.0
- 12
+ latest
enable
cs
enable
@@ -22,8 +22,8 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/MemoryPack.Generator/MemoryPackGenerator.cs b/src/MemoryPack.Generator/MemoryPackGenerator.cs
index 760a4c0a..bb9fa355 100644
--- a/src/MemoryPack.Generator/MemoryPackGenerator.cs
+++ b/src/MemoryPack.Generator/MemoryPackGenerator.cs
@@ -297,11 +297,11 @@ class GeneratorContext : IGeneratorContext
{
SourceProductionContext context;
- public GeneratorContext(SourceProductionContext context, LanguageVersion languageVersion, bool isNet70OrGreater)
+ public GeneratorContext(SourceProductionContext context, LanguageVersion languageVersion, bool isNet7OrGreater)
{
this.context = context;
this.LanguageVersion = languageVersion;
- this.IsNet7OrGreater = isNet70OrGreater;
+ this.IsNet7OrGreater = isNet7OrGreater;
}
public CancellationToken CancellationToken => context.CancellationToken;
diff --git a/src/MemoryPack.Streaming/MemoryPack.Streaming.csproj b/src/MemoryPack.Streaming/MemoryPack.Streaming.csproj
index ea4f3b57..f2717b37 100644
--- a/src/MemoryPack.Streaming/MemoryPack.Streaming.csproj
+++ b/src/MemoryPack.Streaming/MemoryPack.Streaming.csproj
@@ -1,7 +1,7 @@
- net7.0;netstandard2.1
+ net8.0;net9.0;netstandard2.1
enable
enable
$(NoWarn);CS1591;CA2255
@@ -15,11 +15,11 @@
-
+
-
+
diff --git a/src/MemoryPack.UnityShims/MemoryPack.UnityShims.csproj b/src/MemoryPack.UnityShims/MemoryPack.UnityShims.csproj
index a7cd01d5..d5e1cbd9 100644
--- a/src/MemoryPack.UnityShims/MemoryPack.UnityShims.csproj
+++ b/src/MemoryPack.UnityShims/MemoryPack.UnityShims.csproj
@@ -1,7 +1,7 @@
- net7.0;net8.0;netstandard2.1
+ net8.0;net9.0;netstandard2.1
enable
enable
True
@@ -16,8 +16,8 @@
-
-
+
+
Analyzer
false
diff --git a/src/MemoryPack/MemoryPack.csproj b/src/MemoryPack/MemoryPack.csproj
index c8c2a0f2..1fd788f9 100644
--- a/src/MemoryPack/MemoryPack.csproj
+++ b/src/MemoryPack/MemoryPack.csproj
@@ -1,7 +1,7 @@
- net7.0;net8.0;netstandard2.1
+ net8.0;net9.0;netstandard2.1
false
true
@@ -11,10 +11,10 @@
-
+
-
-
+
+
diff --git a/tests/MemoryPack.Tests/MemoryPack.Tests.csproj b/tests/MemoryPack.Tests/MemoryPack.Tests.csproj
index 46caab61..f8a47d33 100644
--- a/tests/MemoryPack.Tests/MemoryPack.Tests.csproj
+++ b/tests/MemoryPack.Tests/MemoryPack.Tests.csproj
@@ -1,19 +1,20 @@
- net8.0
+ net9.0
+ latest
enable
false
true
-
-
-
+
+
+
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/tests/MemoryPack.Tests/SourceGeneratorTests/IncrementalGeneratorTest.cs b/tests/MemoryPack.Tests/SourceGeneratorTests/IncrementalGeneratorTest.cs
index 87f6a9eb..777f9f9b 100644
--- a/tests/MemoryPack.Tests/SourceGeneratorTests/IncrementalGeneratorTest.cs
+++ b/tests/MemoryPack.Tests/SourceGeneratorTests/IncrementalGeneratorTest.cs
@@ -34,5 +34,3 @@ public partial class MyClass
}
}
-
-
diff --git a/tests/MemoryPack.Tests/Utils/CSharpGeneratorRunner.cs b/tests/MemoryPack.Tests/Utils/CSharpGeneratorRunner.cs
index 914069f4..9c82e5af 100644
--- a/tests/MemoryPack.Tests/Utils/CSharpGeneratorRunner.cs
+++ b/tests/MemoryPack.Tests/Utils/CSharpGeneratorRunner.cs
@@ -51,7 +51,7 @@ public static (Compilation, ImmutableArray) RunGenerator(string sour
{
preprocessorSymbols = new[] { "NET7_0_OR_GREATER" };
}
- var parseOptions = new CSharpParseOptions(LanguageVersion.CSharp11, preprocessorSymbols: preprocessorSymbols);
+ var parseOptions = new CSharpParseOptions(LanguageVersion.Latest, preprocessorSymbols: preprocessorSymbols);
var driver = CSharpGeneratorDriver.Create(new MemoryPackGenerator()).WithUpdatedParseOptions(parseOptions);
if (options != null)
@@ -68,7 +68,7 @@ public static (Compilation, ImmutableArray) RunGenerator(string sour
public static (string Key, string Reasons)[][] GetIncrementalGeneratorTrackedStepsReasons(string keyPrefixFilter, params string[] sources)
{
- var parseOptions = new CSharpParseOptions(LanguageVersion.CSharp11);
+ var parseOptions = new CSharpParseOptions(LanguageVersion.Latest);
var driver = CSharpGeneratorDriver.Create(
[new MemoryPackGenerator().AsSourceGenerator()],
driverOptions: new GeneratorDriverOptions(IncrementalGeneratorOutputKind.None, trackIncrementalGeneratorSteps: true))