diff --git a/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs b/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs index db4d1f94f..8ad393e0e 100644 --- a/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs +++ b/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs @@ -83,7 +83,7 @@ public static void Defaults() - net6.0 + net9.0 @@ -93,8 +93,8 @@ public static void Defaults() result.CompilationOptions.NullableContextOptions.ShouldBe(NullableContextOptions.Disable); result.AssemblyName.ShouldBe(Path.GetFileNameWithoutExtension(CsprojFileName)); result.CompilationOptions.AllowUnsafe.ShouldBeFalse(); - result.ParseOptions.LanguageVersion.ShouldBe(LanguageVersion.CSharp10); // Due to net6.0 - result.CompilationOptions.WarningLevel.ShouldBe(6); // Due to net6.0 + result.ParseOptions.LanguageVersion.ShouldBe(LanguageVersion.CSharp13); // Due to net9.0 + result.CompilationOptions.WarningLevel.ShouldBe(9); // Due to net9.0 result.GeneratedSources.ShouldBeEmpty(); } @@ -105,11 +105,11 @@ public static void ParsesTargetFramework() - net6.0 + net9.0 - """).TargetFramework.ShouldBe("net6.0"); + """).TargetFramework.ShouldBe("net9.0"); } [Test] @@ -119,7 +119,7 @@ public static void ParsesOutputType([Values("Library", "Exe", "WinExe")] string - net6.0 + net9.0 {outputType} @@ -139,7 +139,7 @@ public static void ParsesNullable([Values("enable", "disable", "annotations", "w - net6.0 + net9.0 {nullable} @@ -160,7 +160,7 @@ public static void ParsesAssemblyName() - net6.0 + net9.0 Xyz @@ -175,7 +175,7 @@ public static void ParsesAllowUnsafeBlocks([Values("true", "false")] string allo - net6.0 + net9.0 {allowUnsafeBlocks} @@ -200,7 +200,7 @@ public static void ParsesImplicitUsings([Values("true", "enable", "false", "disa - net6.0 + net9.0 {implicitUsings} diff --git a/tools/ExampleTester/ExampleTester.csproj b/tools/ExampleTester/ExampleTester.csproj index c7f2bd809..4a766e98a 100644 --- a/tools/ExampleTester/ExampleTester.csproj +++ b/tools/ExampleTester/ExampleTester.csproj @@ -10,12 +10,16 @@ + + + + - + diff --git a/tools/ExampleTester/FastCsprojCompilationParser.cs b/tools/ExampleTester/FastCsprojCompilationParser.cs index 37b17bf4d..1bcee2aaa 100644 --- a/tools/ExampleTester/FastCsprojCompilationParser.cs +++ b/tools/ExampleTester/FastCsprojCompilationParser.cs @@ -39,13 +39,23 @@ private sealed record TargetFrameworkInfo( LanguageVersion DefaultLanguageVersion, int DefaultWarningLevel); + + // When we add new rows here, we need to add the corresponding NuGet package to ExampleTester.csproj. These packages provide the information used + // for the reference assemblies. private static readonly FrozenDictionary SupportedTargetFrameworks = new KeyValuePair[] { new("net6.0", new(Basic.Reference.Assemblies.Net60.References.All, LanguageVersion.CSharp10, DefaultWarningLevel: 6)), + new("net7.0", new(Basic.Reference.Assemblies.Net70.References.All, LanguageVersion.CSharp11, DefaultWarningLevel: 7)), + new("net8.0", new(Basic.Reference.Assemblies.Net80.References.All, LanguageVersion.CSharp12, DefaultWarningLevel: 8)), + new("net9.0", new(Basic.Reference.Assemblies.Net90.References.All, LanguageVersion.CSharp13, DefaultWarningLevel: 9)), + new("net10.0", new(Basic.Reference.Assemblies.Net100.References.All, LanguageVersion.CSharp14, DefaultWarningLevel: 10)), }.ToFrozenDictionary(StringComparer.OrdinalIgnoreCase); + // When we add new versions, this list changes. You'll need to change the current release from ".NET9_0", + // and add necessary "NET?_0_OR_GREATER" symbols. private static readonly CSharpParseOptions DefaultParseOptions = new(preprocessorSymbols: [ - "TRACE", "RELEASE", "NET", "NET6_0", "NETCOREAPP", "NET5_0_OR_GREATER", "NET6_0_OR_GREATER", + "TRACE", "RELEASE", "NET", "NET9_0", "NETCOREAPP", "NET5_0_OR_GREATER", "NET6_0_OR_GREATER", + "NET7_0_OR_GREATER","NET8_0_OR_GREATER","NET9_0_OR_GREATER", "NETCOREAPP1_0_OR_GREATER", "NETCOREAPP1_1_OR_GREATER", "NETCOREAPP2_0_OR_GREATER", "NETCOREAPP2_1_OR_GREATER", "NETCOREAPP2_2_OR_GREATER", "NETCOREAPP3_0_OR_GREATER", "NETCOREAPP3_1_OR_GREATER"]); @@ -58,7 +68,8 @@ private sealed record TargetFrameworkInfo( new("NU1605", ReportDiagnostic.Error), new("CS1702", ReportDiagnostic.Suppress), new("CS1701", ReportDiagnostic.Suppress), - new("CS8002", ReportDiagnostic.Suppress)]); + new("CS8002", ReportDiagnostic.Suppress), + new("SYSLIB0011", ReportDiagnostic.Error)]); public static CsprojParseResult ParseCsproj(XDocument csprojDocument, string filePath) { diff --git a/tools/MarkdownConverter.Tests/MarkdownConverter.Tests.csproj b/tools/MarkdownConverter.Tests/MarkdownConverter.Tests.csproj index 1c611ee78..6091ac56d 100644 --- a/tools/MarkdownConverter.Tests/MarkdownConverter.Tests.csproj +++ b/tools/MarkdownConverter.Tests/MarkdownConverter.Tests.csproj @@ -15,7 +15,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tools/MarkdownConverter/MarkdownConverter.csproj b/tools/MarkdownConverter/MarkdownConverter.csproj index a1964151d..affc012bb 100644 --- a/tools/MarkdownConverter/MarkdownConverter.csproj +++ b/tools/MarkdownConverter/MarkdownConverter.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/tools/StandardAnchorTags/StandardAnchorTags.csproj b/tools/StandardAnchorTags/StandardAnchorTags.csproj index 8a155f9b8..ccbc4232d 100644 --- a/tools/StandardAnchorTags/StandardAnchorTags.csproj +++ b/tools/StandardAnchorTags/StandardAnchorTags.csproj @@ -8,7 +8,7 @@ - + diff --git a/tools/Utilities/Utilities.csproj b/tools/Utilities/Utilities.csproj index b39c71234..1f670cbbc 100644 --- a/tools/Utilities/Utilities.csproj +++ b/tools/Utilities/Utilities.csproj @@ -8,7 +8,7 @@ - + diff --git a/tools/example-templates/code-in-class-lib-without-using/Project.csproj b/tools/example-templates/code-in-class-lib-without-using/Project.csproj index 42c15ae05..da5fa546e 100644 --- a/tools/example-templates/code-in-class-lib-without-using/Project.csproj +++ b/tools/example-templates/code-in-class-lib-without-using/Project.csproj @@ -1,11 +1,10 @@ - net6.0 + net9.0 $example-name true annotations - 12 diff --git a/tools/example-templates/code-in-class-lib/Project.csproj b/tools/example-templates/code-in-class-lib/Project.csproj index 42c15ae05..da5fa546e 100644 --- a/tools/example-templates/code-in-class-lib/Project.csproj +++ b/tools/example-templates/code-in-class-lib/Project.csproj @@ -1,11 +1,10 @@ - net6.0 + net9.0 $example-name true annotations - 12 diff --git a/tools/example-templates/code-in-main-without-using/Project.csproj b/tools/example-templates/code-in-main-without-using/Project.csproj index 1d23795a8..1475f9029 100644 --- a/tools/example-templates/code-in-main-without-using/Project.csproj +++ b/tools/example-templates/code-in-main-without-using/Project.csproj @@ -2,11 +2,10 @@ Exe - net6.0 + net9.0 annotations $example-name true - 12 diff --git a/tools/example-templates/code-in-main/Project.csproj b/tools/example-templates/code-in-main/Project.csproj index 1d23795a8..1475f9029 100644 --- a/tools/example-templates/code-in-main/Project.csproj +++ b/tools/example-templates/code-in-main/Project.csproj @@ -2,11 +2,10 @@ Exe - net6.0 + net9.0 annotations $example-name true - 12 diff --git a/tools/example-templates/code-in-partial-class/Project.csproj b/tools/example-templates/code-in-partial-class/Project.csproj index 1284619a7..919f7ea83 100644 --- a/tools/example-templates/code-in-partial-class/Project.csproj +++ b/tools/example-templates/code-in-partial-class/Project.csproj @@ -2,11 +2,10 @@ Exe - net6.0 + net9.0 $example-name true annotations - 12 diff --git a/tools/example-templates/extern-lib/ExampleProject.csproj b/tools/example-templates/extern-lib/ExampleProject.csproj index 991e41eff..c51c7b674 100644 --- a/tools/example-templates/extern-lib/ExampleProject.csproj +++ b/tools/example-templates/extern-lib/ExampleProject.csproj @@ -1,11 +1,10 @@ - net6.0 + net9.0 false CS0169 annotations - 9 diff --git a/tools/example-templates/extern-lib/ExternN2.csproj b/tools/example-templates/extern-lib/ExternN2.csproj index c46e546b5..77430f27a 100644 --- a/tools/example-templates/extern-lib/ExternN2.csproj +++ b/tools/example-templates/extern-lib/ExternN2.csproj @@ -1,10 +1,9 @@ - net6.0 + net9.0 false annotations - 9 diff --git a/tools/example-templates/extern-lib/ExternR1.csproj b/tools/example-templates/extern-lib/ExternR1.csproj index 1702c3e3c..59805d570 100644 --- a/tools/example-templates/extern-lib/ExternR1.csproj +++ b/tools/example-templates/extern-lib/ExternR1.csproj @@ -1,10 +1,9 @@ - net6.0 + net9.0 false annotations - 9 diff --git a/tools/example-templates/extern-lib/ExternX.csproj b/tools/example-templates/extern-lib/ExternX.csproj index 2352c5fe0..aa11502c6 100644 --- a/tools/example-templates/extern-lib/ExternX.csproj +++ b/tools/example-templates/extern-lib/ExternX.csproj @@ -1,10 +1,9 @@ - net6.0 + net9.0 false annotations - 9 diff --git a/tools/example-templates/extern-lib/ExternY.csproj b/tools/example-templates/extern-lib/ExternY.csproj index 37fd27528..d001ab65e 100644 --- a/tools/example-templates/extern-lib/ExternY.csproj +++ b/tools/example-templates/extern-lib/ExternY.csproj @@ -1,10 +1,9 @@ - net6.0 + net9.0 false annotations - 9 diff --git a/tools/example-templates/standalone-console-without-using/Project.csproj b/tools/example-templates/standalone-console-without-using/Project.csproj index d10ba4915..5906ff460 100644 --- a/tools/example-templates/standalone-console-without-using/Project.csproj +++ b/tools/example-templates/standalone-console-without-using/Project.csproj @@ -2,10 +2,9 @@ Exe - net6.0 + net9.0 enable disable - 12 $example-name true annotations diff --git a/tools/example-templates/standalone-console/Project.csproj b/tools/example-templates/standalone-console/Project.csproj index 613e8c1b5..1a29ed82e 100644 --- a/tools/example-templates/standalone-console/Project.csproj +++ b/tools/example-templates/standalone-console/Project.csproj @@ -2,10 +2,9 @@ Exe - net6.0 + net9.0 enable disable - 12 $example-name true annotations diff --git a/tools/example-templates/standalone-lib-without-using/Project.csproj b/tools/example-templates/standalone-lib-without-using/Project.csproj index 5ac189498..41f08d501 100644 --- a/tools/example-templates/standalone-lib-without-using/Project.csproj +++ b/tools/example-templates/standalone-lib-without-using/Project.csproj @@ -1,10 +1,9 @@ - net6.0 + net9.0 enable $example-name - 12 true annotations diff --git a/tools/example-templates/standalone-lib/Project.csproj b/tools/example-templates/standalone-lib/Project.csproj index 42c15ae05..da5fa546e 100644 --- a/tools/example-templates/standalone-lib/Project.csproj +++ b/tools/example-templates/standalone-lib/Project.csproj @@ -1,11 +1,10 @@ - net6.0 + net9.0 $example-name true annotations - 12