Skip to content

Commit daf100b

Browse files
authored
Update to net9.0 (dotnet#75465)
* Update to net9.0 * Fixup code * Remove unused references * Fix MSBuild.UnitTests * Update checklist
1 parent b1567b7 commit daf100b

File tree

34 files changed

+59
-51
lines changed

34 files changed

+59
-51
lines changed

.vscode/launch.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/net7.0/BuildValidator.dll",
13+
"program": "${workspaceFolder}/artifacts/bin/BuildValidator/Debug/net9.0/BuildValidator.dll",
1414
"args": [
15-
"--assembliesPath", "./artifacts/obj/csc/Debug/net6.0",
15+
"--assembliesPath", "./artifacts/obj/csc/Debug/net9.0",
1616
"--referencesPath", "./artifacts/bin",
1717
"--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.AspNetCore.App.Ref",
1818
"--referencesPath", "C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Ref",
@@ -29,7 +29,7 @@
2929
"request": "launch",
3030
"preLaunchTask": "build",
3131
// If you have changed target frameworks, make sure to update the program path.
32-
"program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/net7.0/RunTests.dll",
32+
"program": "${workspaceFolder}/artifacts/bin/RunTests/Debug/net9.0/RunTests.dll",
3333
"args": ["--runtime", "both", "--artifactspath", "${workspaceFolder}/artifacts/testPayload/artifacts"],
3434
"cwd": "${workspaceFolder}/artifacts/bin/RunTests",
3535
"stopAtEntry": false,
@@ -41,7 +41,7 @@
4141
"request": "launch",
4242
"preLaunchTask": "build",
4343
// If you have changed target frameworks, make sure to update the program path.
44-
"program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net7.0/PrepareTests.dll",
44+
"program": "${workspaceFolder}/artifacts/bin/PrepareTests/Debug/net9.0/PrepareTests.dll",
4545
"args": [
4646
"--source", "${workspaceFolder}",
4747
"--destination", "${workspaceFolder}/artifacts/testPayload"
@@ -56,7 +56,7 @@
5656
"request": "launch",
5757
"preLaunchTask": "build current project",
5858
// If you have changed target frameworks, make sure to update the program path.
59-
"program": "${workspaceFolder}/artifacts/bin/Replay/Debug/net8.0/Replay.dll",
59+
"program": "${workspaceFolder}/artifacts/bin/Replay/Debug/net9.0/Replay.dll",
6060
"args": [],
6161
"cwd": "${workspaceFolder}/artifacts/bin/Replay",
6262
"stopAtEntry": false,
@@ -68,7 +68,7 @@
6868
"request": "launch",
6969
"preLaunchTask": "build",
7070
// If you have changed target frameworks, make sure to update the program path.
71-
"program": "${workspaceFolder}/artifacts/bin/csc/Debug/net6.0/csc.dll",
71+
"program": "${workspaceFolder}/artifacts/bin/csc/Debug/net9.0/csc.dll",
7272
"args": [],
7373
"cwd": "${workspaceFolder}/src/Compilers/CSharp/csc",
7474
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console

docs/contributing/Target Framework Strategy.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,12 @@ When the .NET SDK RTMs and Roslyn adopts it all occurrences of `$(NetRoslynNext)
110110

111111
**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.
112112

113+
## Checklist for updating TFMs (once a year)
114+
115+
- Update `TargetFrameworks.props`.
116+
- Ensure we have the correct TFM for VS / VSCode (usually not the latest TFM).
117+
- Might need updating `MicrosoftNetCompilersToolsetVersion` in `eng\Versions.props` to consume latest compiler features.
118+
- Change `$(NetRoslynNext)` references to `$(NetRoslyn)` in project files.
119+
- Update TFMs in code/scripts/pipelines (search for the old `netX.0` and replace with the new `netY.0`).
120+
- Check that the same number of tests still run in CI (they are not unintentionally filtered out by TFM).
121+
- Try an official build, a VS insertion.

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<MicrosoftExtensionsOptionsConfigurationExtensionVersion>8.0.0</MicrosoftExtensionsOptionsConfigurationExtensionVersion>
5353
<MicrosoftExtensionsOptionsVersion>8.0.0</MicrosoftExtensionsOptionsVersion>
5454
<MicrosoftExtensionsPrimitivesVersion>8.0.0</MicrosoftExtensionsPrimitivesVersion>
55-
<MicrosoftNetCompilersToolsetVersion>4.11.0-2.24270.4</MicrosoftNetCompilersToolsetVersion>
55+
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.24473.3</MicrosoftNetCompilersToolsetVersion>
5656
<MicrosoftVSSDKBuildToolsVersion>17.9.3137-preview3</MicrosoftVSSDKBuildToolsVersion>
5757
<vswhereVersion>2.4.1</vswhereVersion>
5858
<!--

eng/build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ function TestUsingRunTests() {
394394
$env:ROSLYN_TEST_USEDASSEMBLIES = "true"
395395
}
396396

397-
$runTests = GetProjectOutputBinary "RunTests.dll" -tfm "net8.0"
397+
$runTests = GetProjectOutputBinary "RunTests.dll" -tfm "net9.0"
398398

399399
if (!(Test-Path $runTests)) {
400400
Write-Host "Test runner not found: '$runTests'. Run Build.cmd first." -ForegroundColor Red
@@ -546,7 +546,7 @@ function EnablePreviewSdks() {
546546
# deploying at build time.
547547
function Deploy-VsixViaTool() {
548548

549-
$vsixExe = Join-Path $ArtifactsDir "bin\RunTests\$configuration\net8.0\VSIXExpInstaller\VSIXExpInstaller.exe"
549+
$vsixExe = Join-Path $ArtifactsDir "bin\RunTests\$configuration\net9.0\VSIXExpInstaller\VSIXExpInstaller.exe"
550550
Write-Host "VSIX EXE path: " $vsixExe
551551
if (-not (Test-Path $vsixExe)) {
552552
Write-Host "VSIX EXE not found: '$vsixExe'." -ForegroundColor Red

eng/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,6 @@ if [[ "$test_core_clr" == true ]]; then
377377
if [[ "$ci" != true ]]; then
378378
runtests_args="$runtests_args --html"
379379
fi
380-
dotnet exec "$scriptroot/../artifacts/bin/RunTests/${configuration}/net8.0/RunTests.dll" --runtime core --configuration ${configuration} --logs ${log_dir} --dotnet ${_InitializeDotNetCli}/dotnet $runtests_args
380+
dotnet exec "$scriptroot/../artifacts/bin/RunTests/${configuration}/net9.0/RunTests.dll" --runtime core --configuration ${configuration} --logs ${log_dir} --dotnet ${_InitializeDotNetCli}/dotnet $runtests_args
381381
fi
382382
ExitWithExitCode 0

eng/generate-compiler-code.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function Run-LanguageCore($language, $languageSuffix, $languageDir, $syntaxProje
2323
$errorFileName = if ($language -eq "CSharp") { "ErrorCode.cs" } else { "Errors.vb" }
2424
$errorFilePath = Join-Path $languageDir "Errors\$errorFileName"
2525
$errorGeneratedFilePath = Join-Path $generatedDir "ErrorFacts.Generated.$($languageSuffix)"
26-
$targetFramework = "net8.0"
26+
$targetFramework = "net9.0"
2727

2828
Create-Directory $generatedDir
2929
Create-Directory $generatedTestDir
@@ -75,7 +75,7 @@ function Run-IOperation($coreDir, $ioperationProject) {
7575
$operationsDir = Join-Path $coreDir "Operations"
7676
$operationsXml = Join-Path $operationsDir "OperationInterfaces.xml"
7777
$generationDir = Join-Path $coreDir "Generated"
78-
$targetFramework = "net8.0"
78+
$targetFramework = "net9.0"
7979

8080
if (-not $test) {
8181
Run-Tool $ioperationProject "`"$operationsXml`" `"$generationDir`"" $targetFramework
@@ -92,7 +92,7 @@ function Run-GetTextCore($generatedDir) {
9292
$syntaxTextFilePath = Join-Path $generatedDir "Syntax.xml.GetText.Generated.vb"
9393

9494
Create-Directory $generatedDir
95-
Run-Tool $basicSyntaxProject "`"$syntaxFilePath`" `"$syntaxTextFilePath`" /gettext" "net8.0"
95+
Run-Tool $basicSyntaxProject "`"$syntaxFilePath`" `"$syntaxTextFilePath`" /gettext" "net9.0"
9696
}
9797

9898
function Run-GetText() {

eng/pipelines/test-integration-helix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ stages:
5555
- task: BatchScript@1
5656
displayName: Rehydrate RunTests
5757
inputs:
58-
filename: ./artifacts/bin/RunTests/${{ parameters.configuration }}/net8.0/rehydrate.cmd
58+
filename: ./artifacts/bin/RunTests/${{ parameters.configuration }}/net9.0/rehydrate.cmd
5959
env:
6060
HELIX_CORRELATION_PAYLOAD: '$(Build.SourcesDirectory)\.duplicate'
6161

eng/pipelines/test-unix-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- task: ShellScript@2
4040
displayName: Rehydrate RunTests
4141
inputs:
42-
scriptPath: ./artifacts/bin/RunTests/${{ parameters.configuration }}/net8.0/rehydrate.sh
42+
scriptPath: ./artifacts/bin/RunTests/${{ parameters.configuration }}/net9.0/rehydrate.sh
4343
env:
4444
HELIX_CORRELATION_PAYLOAD: '$(Build.SourcesDirectory)/.duplicate'
4545

eng/pipelines/test-windows-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- task: BatchScript@1
4040
displayName: Rehydrate RunTests
4141
inputs:
42-
filename: ./artifacts/bin/RunTests/${{ parameters.configuration }}/net8.0/rehydrate.cmd
42+
filename: ./artifacts/bin/RunTests/${{ parameters.configuration }}/net9.0/rehydrate.cmd
4343
env:
4444
HELIX_CORRELATION_PAYLOAD: '$(Build.SourcesDirectory)\.duplicate'
4545

eng/prepare-tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ try {
1111
# permissions issues make this a pain to do in PrepareTests itself.
1212
Remove-Item -Recurse -Force "$RepoRoot\artifacts\testPayload" -ErrorAction SilentlyContinue
1313
$dotnet = Ensure-DotNetSdk
14-
Exec-Command $dotnet "exec $RepoRoot\artifacts\bin\PrepareTests\$configuration\net8.0\PrepareTests.dll --source $RepoRoot --destination $RepoRoot\artifacts\testPayload --dotnetPath `"$dotnet`""
14+
Exec-Command $dotnet "exec $RepoRoot\artifacts\bin\PrepareTests\$configuration\net9.0\PrepareTests.dll --source $RepoRoot --destination $RepoRoot\artifacts\testPayload --dotnetPath `"$dotnet`""
1515
exit 0
1616
}
1717
catch {

0 commit comments

Comments
 (0)