diff --git a/.vscode/launch.json b/.vscode/launch.json
index f7da4782cb89a..df92e58e454b2 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -10,9 +10,9 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/net7.0/BuildValidator.dll",
+ "program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/net9.0/BuildValidator.dll",
"args": [
- "--assembliesPath", "./artifacts/obj/csc/Debug/net6.0",
+ "--assembliesPath", "./artifacts/obj/csc/Debug/net9.0",
"--referencesPath", "./artifacts/bin",
"--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.AspNetCore.App.Ref",
"--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref",
@@ -29,7 +29,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/net7.0/RunTests.dll",
+ "program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/net9.0/RunTests.dll",
"args": ["--runtime", "both", "--artifactspath", "${workspaceFolder}/artifacts/testPayload/artifacts"],
"cwd": "${workspaceFolder}/artifacts/bin/RunTests",
"stopAtEntry": false,
@@ -41,7 +41,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net7.0/PrepareTests.dll",
+ "program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net9.0/PrepareTests.dll",
"args": [
"--source", "${workspaceFolder}",
"--destination", "${workspaceFolder}/artifacts/testPayload"
@@ -56,7 +56,7 @@
"request": "launch",
"preLaunchTask": "build current project",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/artifacts/bin/Replay/Debug/net8.0/Replay.dll",
+ "program": "${workspaceFolder}/artifacts/bin/Replay/Debug/net9.0/Replay.dll",
"args": [],
"cwd": "${workspaceFolder}/artifacts/bin/Replay",
"stopAtEntry": false,
@@ -68,7 +68,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
- "program": "${workspaceFolder}/artifacts/bin/csc/Debug/net6.0/csc.dll",
+ "program": "${workspaceFolder}/artifacts/bin/csc/Debug/net9.0/csc.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Compilers/CSharp/csc",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
diff --git a/docs/contributing/Target Framework Strategy.md b/docs/contributing/Target Framework Strategy.md
index 7395188691ce2..4c42206582fce 100644
--- a/docs/contributing/Target Framework Strategy.md
+++ b/docs/contributing/Target Framework Strategy.md
@@ -110,3 +110,12 @@ When the .NET SDK RTMs and Roslyn adopts it all occurrences of `$(NetRoslynNext)
**DO NOT** include both `$(NetRoslyn)` and `$(NetRoslynNext)` in the same project unless there is a very specific reason that both tests are adding value. The most common case is that the runtime has changed behavior and we simply need to update our baselines to match it. Adding extra TFMs for this just increases test time for very little gain.
+## Checklist for updating TFMs (once a year)
+
+- Update `TargetFrameworks.props`.
+ - Ensure we have the correct TFM for VS / VSCode (usually not the latest TFM).
+- Might need updating `MicrosoftNetCompilersToolsetVersion` in `eng\Versions.props` to consume latest compiler features.
+- Change `$(NetRoslynNext)` references to `$(NetRoslyn)` in project files.
+- Update TFMs in code/scripts/pipelines (search for the old `netX.0` and replace with the new `netY.0`).
+- Check that the same number of tests still run in CI (they are not unintentionally filtered out by TFM).
+- Try an official build, a VS insertion.
diff --git a/eng/Versions.props b/eng/Versions.props
index 373da5382af4f..f44990e1e4371 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -52,7 +52,7 @@
8.0.0
8.0.0
8.0.0
- 4.11.0-2.24270.4
+ 4.12.0-3.24473.3
17.9.3137-preview3
2.4.1
- net8.0
- net7.0;net8.0
+ net9.0
+ net8.0;net9.0
net8.0
net8.0
- net7.0;net8.0
+ net8.0
net6.0
net9.0
@@ -67,8 +67,7 @@
-->
- net8.0
- net7.0;net8.0
+ $(NetRoslynAll)
diff --git a/eng/test-rebuild.ps1 b/eng/test-rebuild.ps1
index 05ebf1c658262..68eeda7dfd6c9 100644
--- a/eng/test-rebuild.ps1
+++ b/eng/test-rebuild.ps1
@@ -56,7 +56,7 @@ try {
# Rebuilds with missing references
# Rebuilds with other issues
" --exclude net472\Microsoft.CodeAnalysis.EditorFeatures2.UnitTests.dll" +
- " --exclude net8.0\Microsoft.CodeAnalysis.Collections.Package.dll" +
+ " --exclude net9.0\Microsoft.CodeAnalysis.Collections.Package.dll" +
" --exclude netcoreapp3.1\Microsoft.CodeAnalysis.Collections.Package.dll" +
" --exclude netstandard2.0\Microsoft.CodeAnalysis.Collections.Package.dll" +
" --exclude netstandard2.0\Microsoft.CodeAnalysis.Debugging.Package.dll" +
@@ -67,7 +67,7 @@ try {
# Semantic Search reference assemblies can't be reconstructed from source.
# The assemblies are not marked with ReferenceAssemblyAttribute attribute.
- " --exclude net8.0\GeneratedRefAssemblies\Microsoft.CodeAnalysis.dll" +
+ " --exclude net9.0\GeneratedRefAssemblies\Microsoft.CodeAnalysis.dll" +
" --debugPath `"$ArtifactsDir/BuildValidator`"" +
" --sourcePath `"$RepoRoot/`"" +
diff --git a/src/Compilers/CSharp/Test/Emit/Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.csproj b/src/Compilers/CSharp/Test/Emit/Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.csproj
index aa297ca0ff6be..3276fae69d6c0 100644
--- a/src/Compilers/CSharp/Test/Emit/Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.csproj
+++ b/src/Compilers/CSharp/Test/Emit/Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.csproj
@@ -4,7 +4,7 @@
Library
Microsoft.CodeAnalysis.CSharp.UnitTests
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
true
diff --git a/src/Compilers/CSharp/Test/Emit2/Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj b/src/Compilers/CSharp/Test/Emit2/Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj
index a5058e4b017cf..a79819fbe934a 100644
--- a/src/Compilers/CSharp/Test/Emit2/Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj
+++ b/src/Compilers/CSharp/Test/Emit2/Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests.csproj
@@ -4,7 +4,7 @@
Library
Microsoft.CodeAnalysis.CSharp.UnitTests
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
true
diff --git a/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj b/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj
index a5058e4b017cf..a79819fbe934a 100644
--- a/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj
+++ b/src/Compilers/CSharp/Test/Emit3/Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests.csproj
@@ -4,7 +4,7 @@
Library
Microsoft.CodeAnalysis.CSharp.UnitTests
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
true
diff --git a/src/Compilers/CSharp/csc/CscCommandLine.projitems b/src/Compilers/CSharp/csc/CscCommandLine.projitems
index e1e8c45b3dcda..3aef01cf38e3c 100644
--- a/src/Compilers/CSharp/csc/CscCommandLine.projitems
+++ b/src/Compilers/CSharp/csc/CscCommandLine.projitems
@@ -37,7 +37,6 @@
-
diff --git a/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj b/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj
index eebaf662dbb12..5cd86acd69fc0 100644
--- a/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj
+++ b/src/Compilers/Core/CodeAnalysisTest/Microsoft.CodeAnalysis.UnitTests.csproj
@@ -5,7 +5,7 @@
Library
Microsoft.CodeAnalysis.UnitTests
true
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
diff --git a/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems b/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems
index ff5baba5bec0f..395032d6c3f0a 100644
--- a/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems
+++ b/src/Compilers/Server/VBCSCompiler/VBCSCompilerCommandLine.projitems
@@ -59,8 +59,6 @@
-
-
diff --git a/src/Compilers/Test/Core/Compilation/RuntimeUtilities.cs b/src/Compilers/Test/Core/Compilation/RuntimeUtilities.cs
index 6e29d5625fc80..477074a95c5e8 100644
--- a/src/Compilers/Test/Core/Compilation/RuntimeUtilities.cs
+++ b/src/Compilers/Test/Core/Compilation/RuntimeUtilities.cs
@@ -40,10 +40,6 @@ internal static bool IsCoreClr8OrHigherRuntime
internal static bool IsCoreClr9OrHigherRuntime
=> CoreClrRuntimeVersion is { } v && v >= 9;
-#if NET9_0_OR_GREATER
-#error Make the above check be an #if NET9_OR_GREATER when we add net8 support to build
-#endif
-
internal static BuildPaths CreateBuildPaths(string workingDirectory, string sdkDirectory = null, string tempDirectory = null)
{
tempDirectory ??= Path.GetTempPath();
diff --git a/src/Compilers/VisualBasic/Test/Emit/Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests.vbproj b/src/Compilers/VisualBasic/Test/Emit/Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests.vbproj
index fcac9115700e1..8d447cbc0f24e 100644
--- a/src/Compilers/VisualBasic/Test/Emit/Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests.vbproj
+++ b/src/Compilers/VisualBasic/Test/Emit/Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests.vbproj
@@ -3,7 +3,7 @@
Library
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
diff --git a/src/Compilers/VisualBasic/Test/Semantic/Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.vbproj b/src/Compilers/VisualBasic/Test/Semantic/Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.vbproj
index cadeb770a6c17..9cdceeea624dd 100644
--- a/src/Compilers/VisualBasic/Test/Semantic/Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.vbproj
+++ b/src/Compilers/VisualBasic/Test/Semantic/Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.vbproj
@@ -3,7 +3,7 @@
Library
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
diff --git a/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems b/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems
index 1ff2a55ee9eba..0ac1959f91e31 100644
--- a/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems
+++ b/src/Compilers/VisualBasic/vbc/VbcCommandLine.projitems
@@ -37,7 +37,6 @@
-
diff --git a/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj b/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj
index 55688e4abeed1..da6edb8aff9f5 100644
--- a/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj
+++ b/src/Features/CSharpTest/Microsoft.CodeAnalysis.CSharp.Features.UnitTests.csproj
@@ -3,7 +3,7 @@
Library
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
Microsoft.CodeAnalysis.CSharp.UnitTests
true
diff --git a/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs b/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs
index 152ef7427e734..37288f531803f 100644
--- a/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs
+++ b/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeFixVerifier`2+Test.cs
@@ -38,12 +38,14 @@ static Test()
// reasonable TLS protocol version for outgoing connections.
#pragma warning disable CA5364 // Do Not Use Deprecated Security Protocols
#pragma warning disable CS0618 // Type or member is obsolete
+#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5364 // Do Not Use Deprecated Security Protocols
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
+#pragma warning restore SYSLIB0014 // 'ServicePointManager' is obsolete
}
public Test()
diff --git a/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeRefactoringVerifier`1+Test.cs b/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeRefactoringVerifier`1+Test.cs
index 6fd4da954a54d..06dd59037896e 100644
--- a/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeRefactoringVerifier`1+Test.cs
+++ b/src/Features/DiagnosticsTestUtilities/CodeActions/CSharpCodeRefactoringVerifier`1+Test.cs
@@ -38,12 +38,14 @@ static Test()
// reasonable TLS protocol version for outgoing connections.
#pragma warning disable CA5364 // Do Not Use Deprecated Security Protocols
#pragma warning disable CS0618 // Type or member is obsolete
+#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5364 // Do Not Use Deprecated Security Protocols
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
+#pragma warning restore SYSLIB0014 // 'ServicePointManager' is obsolete
}
public Test()
diff --git a/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs b/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs
index 8d6a064c5614a..4a89ea39fc172 100644
--- a/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs
+++ b/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeFixVerifier`2+Test.cs
@@ -37,12 +37,14 @@ static Test()
// reasonable TLS protocol version for outgoing connections.
#pragma warning disable CA5364 // Do Not Use Deprecated Security Protocols
#pragma warning disable CS0618 // Type or member is obsolete
+#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5364 // Do Not Use Deprecated Security Protocols
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
+#pragma warning restore SYSLIB0014 // 'ServicePointManager' is obsolete
}
public Test()
diff --git a/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeRefactoringVerifier`1+Test.cs b/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeRefactoringVerifier`1+Test.cs
index 04e8e02286e81..7b253715f4971 100644
--- a/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeRefactoringVerifier`1+Test.cs
+++ b/src/Features/DiagnosticsTestUtilities/CodeActions/VisualBasicCodeRefactoringVerifier`1+Test.cs
@@ -37,12 +37,14 @@ static Test()
// reasonable TLS protocol version for outgoing connections.
#pragma warning disable CA5364 // Do Not Use Deprecated Security Protocols
#pragma warning disable CS0618 // Type or member is obsolete
+#pragma warning disable SYSLIB0014 // 'ServicePointManager' is obsolete
if (ServicePointManager.SecurityProtocol == (SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls))
#pragma warning restore CS0618 // Type or member is obsolete
#pragma warning restore CA5364 // Do Not Use Deprecated Security Protocols
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
+#pragma warning restore SYSLIB0014 // 'ServicePointManager' is obsolete
}
public Test()
diff --git a/src/Scripting/CSharpTest/Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests.csproj b/src/Scripting/CSharpTest/Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests.csproj
index 3c7a527a29e20..5e8ced49b9982 100644
--- a/src/Scripting/CSharpTest/Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests.csproj
+++ b/src/Scripting/CSharpTest/Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests.csproj
@@ -5,7 +5,7 @@
Library
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests
true
- $(NetRoslynNext);net472
+ $(NetRoslyn);net472
diff --git a/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs b/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
index d1f46f1ddbfb0..f2d6bf97a59b2 100644
--- a/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
+++ b/src/Tools/BuildBoss/CompilerNuGetCheckerUtil.cs
@@ -186,10 +186,10 @@ private bool CheckPackages(TextWriter textWriter)
(@"tasks\net472", GetProjectOutputDirectory("csi", "net472")),
(@"tasks\net472", GetProjectOutputDirectory("VBCSCompiler", "net472")),
(@"tasks\net472", GetProjectOutputDirectory("Microsoft.Build.Tasks.CodeAnalysis", "net472")),
- (@"tasks\netcore\bincore", GetProjectPublishDirectory("csc", "net8.0")),
- (@"tasks\netcore\bincore", GetProjectPublishDirectory("vbc", "net8.0")),
- (@"tasks\netcore\bincore", GetProjectPublishDirectory("VBCSCompiler", "net8.0")),
- (@"tasks\netcore", GetProjectPublishDirectory("Microsoft.Build.Tasks.CodeAnalysis", "net8.0")));
+ (@"tasks\netcore\bincore", GetProjectPublishDirectory("csc", "net9.0")),
+ (@"tasks\netcore\bincore", GetProjectPublishDirectory("vbc", "net9.0")),
+ (@"tasks\netcore\bincore", GetProjectPublishDirectory("VBCSCompiler", "net9.0")),
+ (@"tasks\netcore", GetProjectPublishDirectory("Microsoft.Build.Tasks.CodeAnalysis", "net9.0")));
foreach (var arch in new[] { "x86", "x64", "arm64" })
{
diff --git a/src/Tools/IdeCoreBenchmarks/IdeCoreBenchmarks.csproj b/src/Tools/IdeCoreBenchmarks/IdeCoreBenchmarks.csproj
index 67a767dbeead6..28af346a9bb44 100644
--- a/src/Tools/IdeCoreBenchmarks/IdeCoreBenchmarks.csproj
+++ b/src/Tools/IdeCoreBenchmarks/IdeCoreBenchmarks.csproj
@@ -5,7 +5,7 @@
Exe
- $(NetVS);net472
+ $(NetRoslyn);net472
false
11
False
diff --git a/src/Tools/Replay/README.md b/src/Tools/Replay/README.md
index 4ed5386bb1e90..3a5f70719d67e 100644
--- a/src/Tools/Replay/README.md
+++ b/src/Tools/Replay/README.md
@@ -34,9 +34,9 @@ To profile with `dotnet trace` first run with the `-w` option to get the PID of
Console 1
```cmd
-e:\code\roslyn\src\Tools\Replay> dotnet run --framework net8.0 --configuration Release e:\code\example\msbuild.binlog -w
+e:\code\roslyn\src\Tools\Replay> dotnet run --framework net9.0 --configuration Release e:\code\example\msbuild.binlog -w
Binary Log: E:\code\example\msbuild.binlog
-Client Directory: E:\code\roslyn\artifacts\bin\Replay\Release\net8.0\
+Client Directory: E:\code\roslyn\artifacts\bin\Replay\Release\net9.0\
Output Directory: E:\code\roslyn\src\Tools\Replay\output
Pipe Name: 0254ccf8-294e-4b8f-a606-70f105b9e4a1
Parallel: 6
diff --git a/src/Workspaces/MSBuildTest/Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.csproj b/src/Workspaces/MSBuildTest/Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.csproj
index fb8224323dc55..9c4abc25d359d 100644
--- a/src/Workspaces/MSBuildTest/Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.csproj
+++ b/src/Workspaces/MSBuildTest/Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.csproj
@@ -4,7 +4,7 @@
Library
Microsoft.CodeAnalysis.MSBuild.UnitTests
- $(NetRoslyn);net472
+ $(NetVS);net472