This is an automated email from the ASF dual-hosted git repository.

paulirwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 9c88340ca Run tests on .NET 9, #1019 (#1052)
9c88340ca is described below

commit 9c88340caaf2a9fda404aba4958b51b8c3e7e8a4
Author: Paul Irwin <[email protected]>
AuthorDate: Thu Dec 12 08:21:10 2024 -0700

    Run tests on .NET 9, #1019 (#1052)
    
    * Run tests on .NET 9; add polyfill for Stream.ReadExactly, #1019
    
    * Add net9.0 to Tests.Analysis.OpenNLP
    
    * Regenerate github test workflows
    
    * Fix assertion issue with .NET 9 x64 returning different results for long 
conversion overflow, #1019
    
    * Add net9.0 to Tests.Cli
    
    * Regenerate github workflow for cli
    
    * Include net9.0 in x86 install hack; add LUCENENET comments to ReadExactly 
use
    
    * Regenerate github workflow for CodeAnalysis
    
    * Add .NET 8 SDK conditionally for ADO build
    
    * Fix typos in publish-test-binaries.yml
    
    * Only target net9.0 for Tests.CodeAnalysis
    
    * Remove ReadExactly usage
    
    * Use windows-latest in ADO pipeline
    
    * Update CodeAnalysis GitHub workflow
    
    * Remove case to install .NET 9 x86 SDK on .NET 8 x86 test run
---
 .build/azure-templates/publish-test-binaries.yml   | 12 +--
 .build/azure-templates/run-tests-on-os.yml         | 30 ++++++-
 .build/runbuild.ps1                                |  2 +-
 .github/workflows/Generate-TestWorkflows.ps1       | 16 +++-
 .github/workflows/Lucene-Net-Tests-AllProjects.yml |  7 +-
 .../workflows/Lucene-Net-Tests-Analysis-Common.yml |  7 +-
 .../Lucene-Net-Tests-Analysis-Kuromoji.yml         |  7 +-
 .../Lucene-Net-Tests-Analysis-Morfologik.yml       |  7 +-
 .../Lucene-Net-Tests-Analysis-OpenNLP.yml          |  7 +-
 .../Lucene-Net-Tests-Analysis-Phonetic.yml         |  7 +-
 .../Lucene-Net-Tests-Analysis-SmartCn.yml          |  7 +-
 .../Lucene-Net-Tests-Analysis-Stempel.yml          |  7 +-
 .github/workflows/Lucene-Net-Tests-Benchmark.yml   |  7 +-
 .../workflows/Lucene-Net-Tests-Classification.yml  |  7 +-
 .github/workflows/Lucene-Net-Tests-Cli.yml         |  7 +-
 .../workflows/Lucene-Net-Tests-CodeAnalysis.yml    |  7 +-
 .github/workflows/Lucene-Net-Tests-Codecs.yml      |  7 +-
 .github/workflows/Lucene-Net-Tests-Demo.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-Expressions.yml |  7 +-
 .github/workflows/Lucene-Net-Tests-Facet.yml       |  7 +-
 .github/workflows/Lucene-Net-Tests-Grouping.yml    |  7 +-
 .github/workflows/Lucene-Net-Tests-Highlighter.yml |  7 +-
 .github/workflows/Lucene-Net-Tests-ICU.yml         |  7 +-
 .github/workflows/Lucene-Net-Tests-Join.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-Memory.yml      |  7 +-
 .github/workflows/Lucene-Net-Tests-Misc.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-Queries.yml     |  7 +-
 .github/workflows/Lucene-Net-Tests-QueryParser.yml |  7 +-
 .github/workflows/Lucene-Net-Tests-Replicator.yml  |  7 +-
 .github/workflows/Lucene-Net-Tests-Sandbox.yml     |  7 +-
 .github/workflows/Lucene-Net-Tests-Spatial.yml     |  7 +-
 .github/workflows/Lucene-Net-Tests-Suggest.yml     |  7 +-
 ...Net-Tests-TestFramework-DependencyInjection.yml |  7 +-
 .../workflows/Lucene-Net-Tests-TestFramework.yml   |  7 +-
 .github/workflows/Lucene-Net-Tests-_A-D.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-_E-I.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-_I-J.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-_J-S.yml        |  7 +-
 .github/workflows/Lucene-Net-Tests-_T-Z.yml        |  7 +-
 Directory.Build.targets                            | 43 ++++++----
 TestTargetFramework.props                          |  6 +-
 azure-pipelines.yml                                | 99 ++++++++++++++++++----
 .../Lucene.Net.Tests.Analysis.OpenNLP.csproj       |  2 +-
 .../JS/TestJavascriptOperations.cs                 | 12 +--
 .../Messages/TestQueryParserResourceProvider.cs    |  4 +-
 .../IndexAndTaxonomyRevisionTest.cs                |  7 +-
 .../IndexInputStreamTest.cs                        |  8 +-
 .../IndexRevisionTest.cs                           |  7 +-
 src/Lucene.Net.Tests/Util/TestOfflineSorter.cs     |  8 +-
 .../Lucene.Net.CodeAnalysis.CSharp.csproj          |  4 +-
 .../Lucene.Net.CodeAnalysis.VisualBasic.csproj     |  5 +-
 .../Lucene.Net.Tests.CodeAnalysis.csproj           |  8 +-
 .../Lucene.Net.Tests.Cli.csproj                    |  2 +-
 53 files changed, 419 insertions(+), 101 deletions(-)

diff --git a/.build/azure-templates/publish-test-binaries.yml 
b/.build/azure-templates/publish-test-binaries.yml
index 870aca691..b65fcfd2d 100644
--- a/.build/azure-templates/publish-test-binaries.yml
+++ b/.build/azure-templates/publish-test-binaries.yml
@@ -5,9 +5,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
-# 
+#
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,7 +19,7 @@
 # to the binary publish subdirectory for the provided target
 # framework, and then publishes to an pipeline artifact.
 
-# NOTE: Depends on environment varable $(RunTests)
+# NOTE: Depends on environment variable $(RunTests)
 
 parameters:
   publishDirectory: '' # The path of the root publish staging directory where 
the binaries can be found $(PublishTempDirectory)
@@ -27,20 +27,20 @@ parameters:
   binaryArtifactName: '' # The prefix of the binary artifact to publish 
$(BinaryArtifactName)
   testSettingsFilePath: 
'$(Build.ArtifactStagingDirectory)/lucene.testsettings.json' #The name of the 
lucene test settings file
   solution: '$(Build.SourcesDirectory)/Lucene.Net.sln'
-  configration: '$(BuildConfiguration)' # The build configuration
+  configuration: '$(BuildConfiguration)' # The build configuration
   platform: '$(BuildPlatform)' # The build platform
 
 steps:
 - pwsh: |
     $solution = "${{ parameters.solution }}"
-    $configuration = "${{ parameters.configration }}"
+    $configuration = "${{ parameters.configuration }}"
     $framework = "${{ parameters.framework }}"
     $publishDirectory = "${{ parameters.publishDirectory }}"
     Write-Host "solution: $solution"
     Write-Host "configuration: $configuration"
     Write-Host "framework: $framework"
     Write-Host "publishDirectory: $publishDirectory"
-    &dotnet publish "${{ parameters.solution }}" --configuration "${{ 
parameters.configration }}" --framework: "${{ parameters.framework }}" 
--no-build --no-restore --verbosity normal /p:TestFrameworks=true 
/p:Platform="${{ parameters.platform }}" /p:AlternatePublishRootDirectory="${{ 
parameters.publishDirectory }}"
+    &dotnet publish "${{ parameters.solution }}" --configuration "${{ 
parameters.configuration }}" --framework: "${{ parameters.framework }}" 
--no-build --no-restore --verbosity normal /p:TestFrameworks=true 
/p:Platform="${{ parameters.platform }}" /p:AlternatePublishRootDirectory="${{ 
parameters.publishDirectory }}"
   displayName: 'Publish Projects for ${{ parameters.framework }}'
   condition: and(succeeded(), ne(variables['RunTests'], 'false'))
 
diff --git a/.build/azure-templates/run-tests-on-os.yml 
b/.build/azure-templates/run-tests-on-os.yml
index dabe18ae4..b0635e9c6 100644
--- a/.build/azure-templates/run-tests-on-os.yml
+++ b/.build/azure-templates/run-tests-on-os.yml
@@ -90,7 +90,7 @@ steps:
     sdkVersion: '${{ parameters.dotNetSdkVersion }}'
     performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}'
 
-    # Hack: .NET 8 no longer installs the x86 bits and they must be installed 
separately. However, it is not
+    # Hack: .NET 8+ no longer installs the x86 bits and they must be installed 
separately. However, it is not
     # trivial to get it into the path and to get it to pass the minimum SDK 
version check in runbuild.ps1.
     # So, we install it afterward and set the environment variable so the 
above SDK can delegate to it.
     # This code only works on Windows.
@@ -105,8 +105,34 @@ steps:
     & $installScriptPath -Version $sdkVersion -Architecture $architecture 
-InstallDir $installPath
     Write-Host "##vso[task.setvariable variable=DOTNET_ROOT_X86;]$installPath"
   displayName: 'Use .NET SDK ${{ parameters.dotNetSdkVersion }} (x86)'
+  condition: and(succeeded(), contains('${{ parameters.framework }}', 
'net9.'), eq('${{ parameters.vsTestPlatform }}', 'x86'))
+
+- task: UseDotNet@2
+  displayName: 'Use .NET SDK 8.0.404'
+  inputs:
+    packageType: 'sdk'
+    version: '8.0.404'
+    performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}'
+  condition: and(succeeded(), contains('${{ parameters.framework }}', 'net8.'))
+
+    # Hack: .NET 8+ no longer installs the x86 bits and they must be installed 
separately. However, it is not
+    # trivial to get it into the path and to get it to pass the minimum SDK 
version check in runbuild.ps1.
+    # So, we install it afterward and set the environment variable so the 
above SDK can delegate to it.
+    # This code only works on Windows.
+- pwsh: |
+    $sdkVersion = '8.0.404'
+    $architecture = '${{ parameters.vsTestPlatform }}'
+    $installScriptPath = "${env:AGENT_TEMPDIRECTORY}/dotnet-install.ps1"
+    $installScriptUrl = 
"https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1";
+    [Net.ServicePointManager]::SecurityProtocol = 
[Net.SecurityProtocolType]::Tls12
+    Invoke-WebRequest $installScriptUrl -OutFile $installScriptPath 
-TimeoutSec 60
+    $installPath = "${env:ProgramFiles(x86)}/dotnet"
+    & $installScriptPath -Version $sdkVersion -Architecture $architecture 
-InstallDir $installPath
+    Write-Host "##vso[task.setvariable variable=DOTNET_ROOT_X86;]$installPath"
+  displayName: 'Use .NET SDK 8.0.404 (x86)'
   condition: and(succeeded(), contains('${{ parameters.framework }}', 
'net8.'), eq('${{ parameters.vsTestPlatform }}', 'x86'))
 
+
 - task: UseDotNet@2
   displayName: 'Use .NET SDK 6.0.421'
   inputs:
@@ -115,7 +141,7 @@ steps:
     performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}'
   condition: and(succeeded(), contains('${{ parameters.framework }}', 'net6.'))
 
-    # Hack: .NET 8 no longer installs the x86 bits and they must be installed 
separately. However, it is not
+    # Hack: .NET 8+ no longer installs the x86 bits and they must be installed 
separately. However, it is not
     # trivial to get it into the path and to get it to pass the minimum SDK 
version check in runbuild.ps1.
     # So, we install it afterward and set the environment variable so the 
above SDK can delegate to it.
     # This code only works on Windows.
diff --git a/.build/runbuild.ps1 b/.build/runbuild.ps1
index 4c0ebd8f8..97bd118e6 100644
--- a/.build/runbuild.ps1
+++ b/.build/runbuild.ps1
@@ -27,7 +27,7 @@ properties {
     [string]$testResultsDirectory = "$artifactsDirectory/TestResults"
     [string]$publishDirectory = "$artifactsDirectory/Publish"
     [string]$solutionFile = "$baseDirectory/Lucene.Net.sln"
-    [string]$minimumSdkVersion = "8.0.100"
+    [string]$minimumSdkVersion = "9.0.100"
     [string]$globalJsonFile = "$baseDirectory/global.json"
     [string]$versionPropsFile = "$baseDirectory/version.props"
     [string]$luceneReadmeFile = "$baseDirectory/src/Lucene.Net/readme-nuget.md"
diff --git a/.github/workflows/Generate-TestWorkflows.ps1 
b/.github/workflows/Generate-TestWorkflows.ps1
index 7faa3b7cc..e29236533 100644
--- a/.github/workflows/Generate-TestWorkflows.ps1
+++ b/.github/workflows/Generate-TestWorkflows.ps1
@@ -38,7 +38,7 @@
 
  .PARAMETER TestFrameworks
     A string array of Dotnet target framework monikers to run the tests on. 
The default is
-    @('net8.0','net6.0','net472','net48').
+    @('net9.0','net8.0','net6.0','net472','net48').
 
  .PARAMETER OperatingSystems
     A string array of Github Actions operating system monikers to run the 
tests on.
@@ -51,6 +51,10 @@
  .PARAMETER Configurations
     A string array of build configurations to run the tests on. The default is 
@('Release').
 
+ .PARAMETER DotNet9SDKVersion
+    The SDK version of .NET 9.x to install on the build agent to be used for 
building and
+    testing. This SDK is always installed on the build agent. The default is 
9.0.x.
+
  .PARAMETER DotNet8SDKVersion
     The SDK version of .NET 8.x to install on the build agent to be used for 
building and
     testing. This SDK is always installed on the build agent. The default is 
8.0.x.
@@ -64,7 +68,7 @@ param(
 
     [string]$RepoRoot = (Split-Path (Split-Path $PSScriptRoot)),
 
-    [string[]]$TestFrameworks = @('net8.0','net6.0','net472','net48'), # 
targets under test: net8.0, netstandard2.1, netstandard2.0, net462
+    [string[]]$TestFrameworks = 
@('net9.0','net8.0','net6.0','net472','net48'), # targets under test: net8.0, 
net8.0, netstandard2.1, netstandard2.0, net462
 
     [string[]]$OperatingSystems = @('windows-latest', 'ubuntu-latest'),
 
@@ -72,6 +76,8 @@ param(
 
     [string[]]$Configurations = @('Release'),
 
+    [string]$DotNet9SDKVersion = '9.0.x',
+
     [string]$DotNet8SDKVersion = '8.0.x',
 
     [string]$DotNet6SDKVersion = '6.0.x'
@@ -154,6 +160,7 @@ function Write-TestWorkflow(
     [string[]]$TestFrameworks = @('net6.0', 'net48'),
     [string[]]$TestPlatforms = @('x64'),
     [string[]]$OperatingSystems = @('windows-latest', 'ubuntu-latest', 
'macos-latest'),
+    [string]$DotNet9SDKVersion = $DotNet9SDKVersion,
     [string]$DotNet8SDKVersion = $DotNet8SDKVersion,
     [string]$DotNet6SDKVersion = $DotNet6SDKVersion) {
 
@@ -286,6 +293,11 @@ jobs:
         with:
           dotnet-version: '$DotNet8SDKVersion'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '$DotNet9SDKVersion'
+
       - name: Setup Environment Variables
         run: |
           `$project_name = 
[System.IO.Path]::GetFileNameWithoutExtension(`$env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-AllProjects.yml 
b/.github/workflows/Lucene-Net-Tests-AllProjects.yml
index a6ff68b15..040280e26 100644
--- a/.github/workflows/Lucene-Net-Tests-AllProjects.yml
+++ b/.github/workflows/Lucene-Net-Tests-AllProjects.yml
@@ -72,7 +72,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -111,6 +111,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml
index 0b4bca60c..df5cdd1ab 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-Common.yml
@@ -56,7 +56,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -95,6 +95,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml
index 9fb6dbf58..88996886a 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml
@@ -53,7 +53,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -92,6 +92,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml
index a7327604f..cead4499f 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml
@@ -53,7 +53,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -92,6 +92,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
index c69a21885..f86bbbddc 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
@@ -56,7 +56,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net48]
+        framework: [net9.0, net8.0, net48]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -95,6 +95,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml
index d666c2e6c..603de1576 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml
@@ -50,7 +50,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -89,6 +89,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml
index 933ff6785..0c9e97fd5 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml
@@ -54,7 +54,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -93,6 +93,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml 
b/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml
index 3d46e4e1c..32d317482 100644
--- a/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml
+++ b/.github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml
@@ -51,7 +51,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -90,6 +90,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Benchmark.yml 
b/.github/workflows/Lucene-Net-Tests-Benchmark.yml
index f47882404..a28136000 100644
--- a/.github/workflows/Lucene-Net-Tests-Benchmark.yml
+++ b/.github/workflows/Lucene-Net-Tests-Benchmark.yml
@@ -63,7 +63,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -102,6 +102,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Classification.yml 
b/.github/workflows/Lucene-Net-Tests-Classification.yml
index 396ad4196..5caefbdf3 100644
--- a/.github/workflows/Lucene-Net-Tests-Classification.yml
+++ b/.github/workflows/Lucene-Net-Tests-Classification.yml
@@ -51,7 +51,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -90,6 +90,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Cli.yml 
b/.github/workflows/Lucene-Net-Tests-Cli.yml
index 32a9e6dde..b23266308 100644
--- a/.github/workflows/Lucene-Net-Tests-Cli.yml
+++ b/.github/workflows/Lucene-Net-Tests-Cli.yml
@@ -70,7 +70,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0]
+        framework: [net9.0, net8.0]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -110,6 +110,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml 
b/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml
index 9c11c5dbc..5cbcf1fcc 100644
--- a/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml
+++ b/.github/workflows/Lucene-Net-Tests-CodeAnalysis.yml
@@ -49,7 +49,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0]
+        framework: [net9.0]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -88,6 +88,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Codecs.yml 
b/.github/workflows/Lucene-Net-Tests-Codecs.yml
index 0a274f570..f92ac1f28 100644
--- a/.github/workflows/Lucene-Net-Tests-Codecs.yml
+++ b/.github/workflows/Lucene-Net-Tests-Codecs.yml
@@ -49,7 +49,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -88,6 +88,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Demo.yml 
b/.github/workflows/Lucene-Net-Tests-Demo.yml
index ebe2f2e23..97a4015d7 100644
--- a/.github/workflows/Lucene-Net-Tests-Demo.yml
+++ b/.github/workflows/Lucene-Net-Tests-Demo.yml
@@ -58,7 +58,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -97,6 +97,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Expressions.yml 
b/.github/workflows/Lucene-Net-Tests-Expressions.yml
index eea9bfce1..e54a075a2 100644
--- a/.github/workflows/Lucene-Net-Tests-Expressions.yml
+++ b/.github/workflows/Lucene-Net-Tests-Expressions.yml
@@ -51,7 +51,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -90,6 +90,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Facet.yml 
b/.github/workflows/Lucene-Net-Tests-Facet.yml
index 522ce9dc0..8fb2874df 100644
--- a/.github/workflows/Lucene-Net-Tests-Facet.yml
+++ b/.github/workflows/Lucene-Net-Tests-Facet.yml
@@ -53,7 +53,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -92,6 +92,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Grouping.yml 
b/.github/workflows/Lucene-Net-Tests-Grouping.yml
index 8ad68ec8e..d50ebcad4 100644
--- a/.github/workflows/Lucene-Net-Tests-Grouping.yml
+++ b/.github/workflows/Lucene-Net-Tests-Grouping.yml
@@ -51,7 +51,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -90,6 +90,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Highlighter.yml 
b/.github/workflows/Lucene-Net-Tests-Highlighter.yml
index 0374cd570..f179c1d0f 100644
--- a/.github/workflows/Lucene-Net-Tests-Highlighter.yml
+++ b/.github/workflows/Lucene-Net-Tests-Highlighter.yml
@@ -53,7 +53,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -92,6 +92,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-ICU.yml 
b/.github/workflows/Lucene-Net-Tests-ICU.yml
index 2c09fd2fd..70bc270fb 100644
--- a/.github/workflows/Lucene-Net-Tests-ICU.yml
+++ b/.github/workflows/Lucene-Net-Tests-ICU.yml
@@ -66,7 +66,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -105,6 +105,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Join.yml 
b/.github/workflows/Lucene-Net-Tests-Join.yml
index d45b52409..eb1b72b46 100644
--- a/.github/workflows/Lucene-Net-Tests-Join.yml
+++ b/.github/workflows/Lucene-Net-Tests-Join.yml
@@ -52,7 +52,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -91,6 +91,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Memory.yml 
b/.github/workflows/Lucene-Net-Tests-Memory.yml
index c996b24b0..29aef5fec 100644
--- a/.github/workflows/Lucene-Net-Tests-Memory.yml
+++ b/.github/workflows/Lucene-Net-Tests-Memory.yml
@@ -54,7 +54,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -93,6 +93,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Misc.yml 
b/.github/workflows/Lucene-Net-Tests-Misc.yml
index fbd15412e..c83171e95 100644
--- a/.github/workflows/Lucene-Net-Tests-Misc.yml
+++ b/.github/workflows/Lucene-Net-Tests-Misc.yml
@@ -50,7 +50,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -89,6 +89,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Queries.yml 
b/.github/workflows/Lucene-Net-Tests-Queries.yml
index e88e22adf..3073b3d0d 100644
--- a/.github/workflows/Lucene-Net-Tests-Queries.yml
+++ b/.github/workflows/Lucene-Net-Tests-Queries.yml
@@ -50,7 +50,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -89,6 +89,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-QueryParser.yml 
b/.github/workflows/Lucene-Net-Tests-QueryParser.yml
index 79f235ba2..37a6f3a14 100644
--- a/.github/workflows/Lucene-Net-Tests-QueryParser.yml
+++ b/.github/workflows/Lucene-Net-Tests-QueryParser.yml
@@ -56,7 +56,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -95,6 +95,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Replicator.yml 
b/.github/workflows/Lucene-Net-Tests-Replicator.yml
index 53f655a13..114b882f9 100644
--- a/.github/workflows/Lucene-Net-Tests-Replicator.yml
+++ b/.github/workflows/Lucene-Net-Tests-Replicator.yml
@@ -55,7 +55,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -94,6 +94,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Sandbox.yml 
b/.github/workflows/Lucene-Net-Tests-Sandbox.yml
index 07782e84d..8067ad8f5 100644
--- a/.github/workflows/Lucene-Net-Tests-Sandbox.yml
+++ b/.github/workflows/Lucene-Net-Tests-Sandbox.yml
@@ -51,7 +51,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -90,6 +90,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Spatial.yml 
b/.github/workflows/Lucene-Net-Tests-Spatial.yml
index 60cb28961..53bbbd895 100644
--- a/.github/workflows/Lucene-Net-Tests-Spatial.yml
+++ b/.github/workflows/Lucene-Net-Tests-Spatial.yml
@@ -52,7 +52,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -91,6 +91,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-Suggest.yml 
b/.github/workflows/Lucene-Net-Tests-Suggest.yml
index ec610d360..4c9d33de8 100644
--- a/.github/workflows/Lucene-Net-Tests-Suggest.yml
+++ b/.github/workflows/Lucene-Net-Tests-Suggest.yml
@@ -53,7 +53,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -92,6 +92,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git 
a/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml 
b/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml
index 38c10f408..e36db65f2 100644
--- a/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml
+++ b/.github/workflows/Lucene-Net-Tests-TestFramework-DependencyInjection.yml
@@ -49,7 +49,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -88,6 +88,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-TestFramework.yml 
b/.github/workflows/Lucene-Net-Tests-TestFramework.yml
index 6909acad5..b757190ed 100644
--- a/.github/workflows/Lucene-Net-Tests-TestFramework.yml
+++ b/.github/workflows/Lucene-Net-Tests-TestFramework.yml
@@ -51,7 +51,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -90,6 +90,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-_A-D.yml 
b/.github/workflows/Lucene-Net-Tests-_A-D.yml
index 5ca568ff3..5389a3dc2 100644
--- a/.github/workflows/Lucene-Net-Tests-_A-D.yml
+++ b/.github/workflows/Lucene-Net-Tests-_A-D.yml
@@ -60,7 +60,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -99,6 +99,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-_E-I.yml 
b/.github/workflows/Lucene-Net-Tests-_E-I.yml
index 76c3e2222..a9c7bd08d 100644
--- a/.github/workflows/Lucene-Net-Tests-_E-I.yml
+++ b/.github/workflows/Lucene-Net-Tests-_E-I.yml
@@ -70,7 +70,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -109,6 +109,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-_I-J.yml 
b/.github/workflows/Lucene-Net-Tests-_I-J.yml
index 4f5271a7a..2a5655409 100644
--- a/.github/workflows/Lucene-Net-Tests-_I-J.yml
+++ b/.github/workflows/Lucene-Net-Tests-_I-J.yml
@@ -75,7 +75,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -114,6 +114,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-_J-S.yml 
b/.github/workflows/Lucene-Net-Tests-_J-S.yml
index 6aeb2f00f..e7d5c4314 100644
--- a/.github/workflows/Lucene-Net-Tests-_J-S.yml
+++ b/.github/workflows/Lucene-Net-Tests-_J-S.yml
@@ -62,7 +62,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -101,6 +101,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/.github/workflows/Lucene-Net-Tests-_T-Z.yml 
b/.github/workflows/Lucene-Net-Tests-_T-Z.yml
index 3f4996e49..dbc6ac011 100644
--- a/.github/workflows/Lucene-Net-Tests-_T-Z.yml
+++ b/.github/workflows/Lucene-Net-Tests-_T-Z.yml
@@ -57,7 +57,7 @@ jobs:
       fail-fast: false
       matrix:
         os: [windows-latest, ubuntu-latest]
-        framework: [net8.0, net6.0, net48, net472]
+        framework: [net9.0, net8.0, net6.0, net48, net472]
         platform: [x64]
         configuration: [Release]
         exclude:
@@ -96,6 +96,11 @@ jobs:
         with:
           dotnet-version: '8.0.x'
 
+      - name: Setup .NET 9 SDK
+        uses: actions/setup-dotnet@v3
+        with:
+          dotnet-version: '9.0.x'
+
       - name: Setup Environment Variables
         run: |
           $project_name = 
[System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 331787ecd..fd71ab055 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -30,8 +30,15 @@
     <PublishDir Condition="'$(AlternatePublishRootDirectory)' != 
''">$(AlternatePublishRootDirectory)/$(TargetFramework)/$(MSBuildProjectName)/</PublishDir>
   </PropertyGroup>
 
-  <!-- Features in .NET 6.x, .NET 7.x, and .NET 8.x only -->
-  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET 9.x only -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net9.')) ">
+
+    
<DefineConstants>$(DefineConstants);FEATURE_STREAM_READEXACTLY</DefineConstants>
+
+  </PropertyGroup>
+
+  <!-- Features in .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x only -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     
<DefineConstants>$(DefineConstants);FEATURE_RANDOM_NEXTINT64_NEXTSINGLE</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_SPANFORMATTABLE</DefineConstants>
@@ -39,16 +46,16 @@
 
   </PropertyGroup>
 
-  <!-- Features in .NET 5.x, .NET 6.x, .NET 7.x, and .NET 8.x only -->
-  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x only 
-->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     
<DefineConstants>$(DefineConstants);FEATURE_ASPNETCORE_ENDPOINT_CONFIG</DefineConstants>
     <DefineConstants>$(DefineConstants);FEATURE_READONLYSET</DefineConstants>
 
   </PropertyGroup>
 
-  <!-- Features in .NET Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, and .NET 8.x 
only -->
-  <PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and 
.NET 9.x only -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     <DefineConstants>$(DefineConstants);FEATURE_ARGITERATOR</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_PROCESS_KILL_ENTIREPROCESSTREE</DefineConstants>
@@ -56,8 +63,8 @@
 
   </PropertyGroup>
 
-  <!-- Features in .NET Standard, .NET Core, .NET 5.x, .NET 6.x, .NET 7.x, and 
.NET 8.x only (no .NET Framework support) -->
-  <PropertyGroup Condition=" $(TargetFramework.StartsWith('netstandard')) Or 
$(TargetFramework.StartsWith('netcoreapp')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET Standard, .NET Core, .NET 5.x, .NET 6.x, .NET 7.x, 
.NET 8.x, and .NET 9.x only (no .NET Framework support) -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('netstandard')) Or 
$(TargetFramework.StartsWith('netcoreapp')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_CULTUREINFO_CURRENTCULTURE_SETTER</DefineConstants>
@@ -66,8 +73,8 @@
     <DebugType>portable</DebugType>
   </PropertyGroup>
 
-  <!-- Features in .NET Standard 2.1, .NET 5.x, .NET 6.x, .NET 7.x, and .NET 
8.x only -->
-  <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET Standard 2.1, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, 
and .NET 9.x only -->
+  <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     <DefineConstants>$(DefineConstants);FEATURE_ARRAY_FILL</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_CONDITIONALWEAKTABLE_ENUMERATOR</DefineConstants>
@@ -79,26 +86,30 @@
 
   </PropertyGroup>
 
-  <!-- Features in .NET Standard 2.x, .NET Core 2.x, .NET Core 3.x, .NET 5.x, 
.NET 6.x, .NET 7.x, and .NET 8.x -->
-  <PropertyGroup Condition=" $(TargetFramework.StartsWith('netstandard2.')) Or 
$(TargetFramework.StartsWith('netcoreapp2.')) Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET Standard 2.x, .NET Core 2.x, .NET Core 3.x, .NET 5.x, 
.NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('netstandard2.')) Or 
$(TargetFramework.StartsWith('netcoreapp2.')) Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     
<DefineConstants>$(DefineConstants);FEATURE_ICONFIGURATIONROOT_PROVIDERS</DefineConstants>
 
   </PropertyGroup>
 
-  <!-- Features in .NET Framework 4.5+, .NET Standard 2.x, .NET Core 2.x, .NET 
Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, and .NET 8.x  -->
-  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or 
$(TargetFramework.StartsWith('netstandard2.')) Or 
$(TargetFramework.StartsWith('netcoreapp2.')) Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+  <!-- Features in .NET Framework 4.5+, .NET Standard 2.x, .NET Core 2.x, .NET 
Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, .NET 8.x, and .NET 9.x  -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or 
$(TargetFramework.StartsWith('netstandard2.')) Or 
$(TargetFramework.StartsWith('netcoreapp2.')) Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) Or 
$(TargetFramework.StartsWith('net9.')) ">
 
     
<DefineConstants>$(DefineConstants);FEATURE_ASSEMBLY_GETCALLINGASSEMBLY</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_FILESTREAM_LOCK</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_TEXTWRITER_CLOSE</DefineConstants>
-    <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
-    
<DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_THREADPOOL_UNSAFEQUEUEWORKITEM</DefineConstants>
     
<DefineConstants>$(DefineConstants);FEATURE_TYPE_GETMETHOD__BINDINGFLAGS_PARAMS</DefineConstants>
 
   </PropertyGroup>
 
+  <!-- Features in .NET Framework 4.5+, .NET Standard 2.x, .NET Core 2.x, .NET 
Core 3.x, .NET 5.x, .NET 6.x, .NET 7.x, and .NET 8.x (No .NET 9.x support)  -->
+  <PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or 
$(TargetFramework.StartsWith('netstandard2.')) Or 
$(TargetFramework.StartsWith('netcoreapp2.')) Or 
$(TargetFramework.StartsWith('netcoreapp3.')) Or 
$(TargetFramework.StartsWith('net5.')) Or 
$(TargetFramework.StartsWith('net6.')) Or 
$(TargetFramework.StartsWith('net7.')) Or 
$(TargetFramework.StartsWith('net8.')) ">
+    
<DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE_EXCEPTIONS</DefineConstants>
+    <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants>
+  </PropertyGroup>
+
   <!-- Features in .NET Framework 4.5+ and .NET Standard 2.x only (No .NET 
Core support) -->
   <PropertyGroup Condition=" $(TargetFramework.StartsWith('net4')) Or 
$(TargetFramework.StartsWith('netstandard2.')) ">
 
diff --git a/TestTargetFramework.props b/TestTargetFramework.props
index a37082638..3b90f2b16 100644
--- a/TestTargetFramework.props
+++ b/TestTargetFramework.props
@@ -29,7 +29,8 @@
     <!--<TargetFramework>net472</TargetFramework>-->
     <!--<TargetFramework>net48</TargetFramework>-->
     <!--<TargetFramework>net6.0</TargetFramework>-->
-    <TargetFramework>net8.0</TargetFramework>
+    <!--<TargetFramework>net8.0</TargetFramework>-->
+    <TargetFramework>net9.0</TargetFramework>
 
     <!-- Allow the build script to pass in the test frameworks to build for.
       This overrides the above TargetFramework setting.
@@ -37,13 +38,14 @@
 
     <!-- Test Client to DLL target works as follows:
       Test Client       | Target Under Test
+      net9.0            | net8.0
       net8.0            | net8.0
       net6.0            | netstandard2.1
       net48             | net462
       net472            | netstandard2.0
     -->
 
-    <TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' 
">net8.0;net6.0</TargetFrameworks>
+    <TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' 
">net9.0;net8.0;net6.0</TargetFrameworks>
     <TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' AND 
$([MSBuild]::IsOsPlatform('Windows')) 
">$(TargetFrameworks);net48;net472</TargetFrameworks>
     <TargetFramework Condition=" '$(TargetFrameworks)' != '' 
"></TargetFramework>
   </PropertyGroup>
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 2c256a7b3..5771dd755 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -55,7 +55,7 @@ variables:
 - name: BuildCounter
   value: 
$[counter(variables['VersionSuffix'],coalesce(variables['BuildCounterSeed'], 
1250))]
 - name: DotNetSDKVersion
-  value: '8.0.204'
+  value: '9.0.100'
 - name: DocumentationArtifactName
   value: 'docs'
 - name: DocumentationArtifactZipFileName
@@ -99,7 +99,7 @@ stages:
 
   - job: Build
     pool:
-      vmImage: 'windows-2019'
+      vmImage: 'windows-latest'
 
     steps:
 
@@ -229,13 +229,22 @@ stages:
       displayName: 'Delete temp publish location: $(NuGetArtifactDirectory)'
       condition: and(succeeded(), ne(variables['RunPack'], 'false'))
 
+    - template: '.build/azure-templates/publish-test-binaries.yml'
+      parameters:
+        publishDirectory: $(PublishDirectory)
+        framework: 'net9.0'
+        binaryArtifactName: '$(BinaryArtifactName)'
+        testSettingsFilePath: 
'$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)'
+        configuration: '$(BuildConfiguration)'
+        platform: '$(BuildPlatform)'
+
     - template: '.build/azure-templates/publish-test-binaries.yml'
       parameters:
         publishDirectory: $(PublishDirectory)
         framework: 'net8.0'
         binaryArtifactName: '$(BinaryArtifactName)'
         testSettingsFilePath: 
'$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)'
-        configration: '$(BuildConfiguration)'
+        configuration: '$(BuildConfiguration)'
         platform: '$(BuildPlatform)'
 
     - template: '.build/azure-templates/publish-test-binaries.yml'
@@ -244,7 +253,7 @@ stages:
         framework: 'net6.0'
         binaryArtifactName: '$(BinaryArtifactName)'
         testSettingsFilePath: 
'$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)'
-        configration: '$(BuildConfiguration)'
+        configuration: '$(BuildConfiguration)'
         platform: '$(BuildPlatform)'
 
     - template: '.build/azure-templates/publish-test-binaries.yml'
@@ -253,7 +262,7 @@ stages:
         framework: 'net472'
         binaryArtifactName: '$(BinaryArtifactName)'
         testSettingsFilePath: 
'$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)'
-        configration: '$(BuildConfiguration)'
+        configuration: '$(BuildConfiguration)'
         platform: '$(BuildPlatform)'
 
     - template: '.build/azure-templates/publish-test-binaries.yml'
@@ -262,7 +271,7 @@ stages:
         framework: 'net48'
         binaryArtifactName: '$(BinaryArtifactName)'
         testSettingsFilePath: 
'$(Build.ArtifactStagingDirectory)/$(TestSettingsFileName)'
-        configration: '$(BuildConfiguration)'
+        configuration: '$(BuildConfiguration)'
         platform: '$(BuildPlatform)'
 
   - job: Docs
@@ -326,6 +335,66 @@ stages:
   displayName: 'Test Stage:'
   jobs:
 
+  - job: Test_net9_0_x64
+    condition: and(succeeded(), ne(variables['RunTests'], 'false'))
+    strategy:
+      matrix:
+        Windows:
+          osName: 'Windows'
+          imageName: 'windows-latest'
+          maximumParallelJobs: 8
+          maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
+        Linux:
+          osName: 'Linux'
+          imageName: 'ubuntu-latest'
+          maximumParallelJobs: 7
+          maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
+        macOS:
+          osName: 'macOS'
+          imageName: 'macOS-latest'
+          maximumParallelJobs: 7
+          maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
+    displayName: 'Test net9.0,x64 on'
+    pool:
+      vmImage: $(imageName)
+    steps:
+      - template: '.build/azure-templates/run-tests-on-os.yml'
+        parameters:
+          osName: $(osName)
+          framework: 'net9.0'
+          vsTestPlatform: 'x64'
+          testBinariesArtifactName: '$(TestBinariesArtifactName)'
+          nugetArtifactName: '$(NuGetArtifactName)'
+          testResultsArtifactName: '$(TestResultsArtifactName)'
+          maximumParallelJobs: $(maximumParallelJobs)
+          maximumAllowedFailures: $(maximumAllowedFailures)
+          dotNetSdkVersion: '$(DotNetSDKVersion)'
+
+  - job: Test_net9_0_x86 # Only run Nightly or if explicitly enabled with 
RunX86Tests
+    condition: and(succeeded(), ne(variables['RunTests'], 'false'), 
or(eq(variables['IsNightly'], 'true'), eq(variables['RunX86Tests'], 'true')))
+    strategy:
+      matrix:
+        Windows:
+          osName: 'Windows'
+          imageName: 'windows-latest'
+          maximumParallelJobs: 8
+          maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
+    displayName: 'Test net9.0,x86 on'
+    pool:
+      vmImage: $(imageName)
+    steps:
+      - template: '.build/azure-templates/run-tests-on-os.yml'
+        parameters:
+          osName: $(osName)
+          framework: 'net9.0'
+          vsTestPlatform: 'x86'
+          testBinariesArtifactName: '$(TestBinariesArtifactName)'
+          nugetArtifactName: '$(NuGetArtifactName)'
+          testResultsArtifactName: '$(TestResultsArtifactName)'
+          maximumParallelJobs: $(maximumParallelJobs)
+          maximumAllowedFailures: $(maximumAllowedFailures)
+          dotNetSdkVersion: '$(DotNetSDKVersion)'
+
   - job: Test_net8_0_x64
     condition: and(succeeded(), ne(variables['RunTests'], 'false'))
     strategy:
@@ -367,7 +436,7 @@ stages:
       matrix:
         Windows:
           osName: 'Windows'
-          imageName: 'windows-2019'
+          imageName: 'windows-latest'
           maximumParallelJobs: 8
           maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
     displayName: 'Test net8.0,x86 on'
@@ -392,7 +461,7 @@ stages:
       matrix:
         Windows:
           osName: 'Windows'
-          imageName: 'windows-2019'
+          imageName: 'windows-latest'
           maximumParallelJobs: 8
           maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
         Linux:
@@ -427,7 +496,7 @@ stages:
       matrix:
         Windows:
           osName: 'Windows'
-          imageName: 'windows-2019'
+          imageName: 'windows-latest'
           maximumParallelJobs: 8
           maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
     displayName: 'Test net6.0,x86 on'
@@ -452,7 +521,7 @@ stages:
       matrix:
         Windows:
           osName: 'Windows'
-          imageName: 'windows-2019'
+          imageName: 'windows-latest'
           maximumParallelJobs: 8
           maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
     displayName: 'Test net472,x64 on'
@@ -477,7 +546,7 @@ stages:
       matrix:
         Windows:
           osName: 'Windows'
-          imageName: 'windows-2019'
+          imageName: 'windows-latest'
           maximumParallelJobs: 8
           maximumAllowedFailures: 0 # Maximum allowed failures for a 
successful build
     displayName: 'Test net472,x86 on'
@@ -500,7 +569,7 @@ stages:
     condition: and(succeeded(), ne(variables['RunTests'], 'false'))
     displayName: 'Test net48,x64 on Windows'
     pool:
-      vmImage: 'windows-2019'
+      vmImage: 'windows-latest'
     steps:
     - template: '.build/azure-templates/run-tests-on-os.yml'
       parameters:
@@ -518,7 +587,7 @@ stages:
     condition: and(succeeded(), ne(variables['RunTests'], 'false'), 
or(eq(variables['IsNightly'], 'true'), eq(variables['RunX86Tests'], 'true')))
     displayName: 'Test net48,x86 on Windows'
     pool:
-      vmImage: 'windows-2019'
+      vmImage: 'windows-latest'
     steps:
     - template: '.build/azure-templates/run-tests-on-os.yml'
       parameters:
@@ -542,7 +611,7 @@ stages:
   - job: Publish_Azure_Artifacts
     condition: and(succeeded(), ne(variables['ArtifactFeedID'], ''))
     pool:
-      vmImage: 'windows-2019'
+      vmImage: 'windows-latest'
 
     steps:
       # We checkout here because we need to publish the source code along with 
the symbols for debugging
@@ -584,7 +653,7 @@ stages:
     condition: and(succeeded(), eq(variables['IsRelease'], 'true'))
     displayName: 'Build Release Artifacts for [VOTE]'
     pool:
-      vmImage: 'windows-2019'
+      vmImage: 'windows-latest'
 
     steps:
     # We checkout here because we need to publish the source code along with 
the binaries per Apache's releae policy
diff --git 
a/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
 
b/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
index a4cf98a0c..06e24f552 100644
--- 
a/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
+++ 
b/src/Lucene.Net.Tests.Analysis.OpenNLP/Lucene.Net.Tests.Analysis.OpenNLP.csproj
@@ -26,7 +26,7 @@
   <PropertyGroup>
     <!-- Allow specific target framework to flow in from 
TestTargetFrameworks.props -->
     <!--suppress MsbuildTargetFrameworkTagInspection - even though this only 
has one target right now, we need to use the plural version for the line below 
-->
-    <TargetFrameworks Condition=" '$(TargetFramework)' == '' 
">net8.0</TargetFrameworks>
+    <TargetFrameworks Condition=" '$(TargetFramework)' == '' 
">net9.0;net8.0</TargetFrameworks>
     <TargetFrameworks Condition=" '$(TargetFramework)' == '' AND 
$([MSBuild]::IsOsPlatform('Windows')) 
">$(TargetFrameworks);net48</TargetFrameworks>
 
     <AssemblyTitle>Lucene.Net.Tests.Analysis.OpenNLP</AssemblyTitle>
diff --git a/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs 
b/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs
index 595580a19..bf6d01aab 100644
--- a/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs
+++ b/src/Lucene.Net.Tests.Expressions/JS/TestJavascriptOperations.cs
@@ -93,17 +93,19 @@ namespace Lucene.Net.Expressions.JS
             AssertEvaluatesTo("10/5/2", 1);
             AssertEvaluatesTo("(27/9)/3", 1);
             AssertEvaluatesTo("27/(9/3)", 9);
-            // LUCENENET: division overflow cast to double then to long 
evaluates to long.MinValue, except on arm64
+            // LUCENENET: division overflow cast to double then to long 
evaluates to long.MinValue, except on arm64 (and .NET 9 x64)
             // where it matches Java's behavior and Lucene's assertion. This 
only happens with the conv.i8 opcode with
             // positive infinity on the stack. 1.0 / 0.0 == 
double.PositiveInfinity. In C#, if you cast
             // double.PositiveInfinity to long in an unchecked context it 
returns 0. The C# spec for conversion in an
             // unchecked context from double to long states "If the value of 
the operand is NaN or infinite, the result
             // of the conversion is an unspecified value of the destination 
type." Likewise, the docs for conv.i8 state
             // "If overflow occurs converting a floating-point type to an 
integer the value returned is unspecified."
-            // Essentially this is undefined behavior, so we are going to 
assert an architecture-specific value
-            // primarily to ensure it produces something rather than throws. 
CPU architectures other than arm64, x86,
-            // and x64 may produce different results.
-            AssertEvaluatesTo("1/0", RuntimeInformation.ProcessArchitecture == 
Architecture.Arm64 ? 9223372036854775807 : -9223372036854775808);
+            // Essentially this is undefined behavior, so we are going to 
assert that it produces one of the two
+            // known expected values (long.MinValue or long.MaxValue) rather 
than throws.
+            // CPU architectures other than arm64, x86, and x64 may produce 
different results.
+            Expression evaluator = JavascriptCompiler.Compile("1/0");
+            long actual = (long)evaluator.Evaluate(0, null);
+            Assert.IsTrue(actual is long.MinValue or long.MaxValue, "Expected 
long.MaxValue or long.MinValue, but got: " + actual);
         }
 
         [Test]
diff --git 
a/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs
 
b/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs
index 6979df464..caa4bfab7 100644
--- 
a/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs
+++ 
b/src/Lucene.Net.Tests.QueryParser/Support/Flexible/Core/Messages/TestQueryParserResourceProvider.cs
@@ -97,7 +97,9 @@ namespace 
Lucene.Net.QueryParsers.Support.Flexible.Core.Messages // LUCENENET: T
             // Get the expected bytes
             using var expectedStream = 
GetType().Assembly.GetManifestResourceStream("Lucene.Net.QueryParsers.Support.Flexible.Core.Messages.lucene-net-icon-32x32.png");
             byte[] expectedBytes = new byte[expectedStream.Length];
-            expectedStream.Read(expectedBytes, 0, (int)expectedStream.Length);
+
+            var numRead = expectedStream.Read(expectedBytes, 0, 
(int)expectedStream.Length); // LUCENENET specific - asserting that we read the 
entire buffer
+            Assert.AreEqual(expectedStream.Length, numRead);
 
             // Check the wrapper to ensure we can read the bytes
             Assert.AreEqual(expectedBytes, MessagesTest.LUCENE_NET_ICON_32x32);
diff --git a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs 
b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs
index f12f9972e..5c1936aea 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexAndTaxonomyRevisionTest.cs
@@ -178,7 +178,10 @@ namespace Lucene.Net.Replicator
                             offset = skip;
                         }
                         src.ReadBytes(srcBytes, offset, srcBytes.Length - 
offset);
-                        @in.Read(inBytes, offset, inBytes.Length - offset);
+
+                        var numRead = @in.Read(inBytes, offset, inBytes.Length 
- offset); // LUCENENET specific - asserting that we read the entire buffer
+                        assertEquals(inBytes.Length - offset, numRead);
+
                         assertArrayEquals(srcBytes, inBytes);
                     }
                 }
@@ -189,4 +192,4 @@ namespace Lucene.Net.Replicator
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs 
b/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs
index f060eba98..25e22f427 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexInputStreamTest.cs
@@ -30,7 +30,7 @@ namespace Lucene.Net.Tests.Replicator
     [LuceneNetSpecific]
     public class IndexInputStreamTest : LuceneTestCase
     {
-        
+
         [Test]
         [LuceneNetSpecific]
         public void 
Read_RemainingIndexInputLargerThanReadCount_ReturnsReadCount()
@@ -55,7 +55,11 @@ namespace Lucene.Net.Tests.Replicator
             int readBytes = 1.KiloBytes();
             byte[] readBuffer = new byte[readBytes];
             for (int i = section; i > 0; i--)
-                stream.Read(readBuffer, 0, readBytes);
+            {
+                var numRead = stream.Read(readBuffer, 0, readBytes); // 
LUCENENET specific - asserting that we read the entire buffer
+                Assert.AreEqual(readBytes, numRead);
+            }
+
             Assert.AreEqual(readBuffer, buffer.Skip((section - 1) * 
readBytes).Take(readBytes).ToArray());
         }
 
diff --git a/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs 
b/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs
index a43a51a36..d3c5a9146 100644
--- a/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs
+++ b/src/Lucene.Net.Tests.Replicator/IndexRevisionTest.cs
@@ -160,7 +160,10 @@ namespace Lucene.Net.Replicator
                         offset = skip;
                     }
                     src.ReadBytes(srcBytes, offset, srcBytes.Length - offset);
-                    @in.Read(inBytes, offset, inBytes.Length - offset);
+
+                    var numRead = @in.Read(inBytes, offset, inBytes.Length - 
offset); // LUCENENET specific - asserting that we read the entire buffer
+                    assertEquals(inBytes.Length - offset, numRead);
+
                     assertArrayEquals(srcBytes, inBytes);
                     IOUtils.Dispose(src, @in);
                 }
@@ -171,4 +174,4 @@ namespace Lucene.Net.Replicator
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs 
b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
index dc5efe6ea..3f9ae8929 100644
--- a/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
+++ b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
@@ -231,7 +231,9 @@ namespace Lucene.Net.Util
             using Stream is2 = sorted.Open(FileMode.Open, FileAccess.Read, 
FileShare.Delete);
             while ((len = is1.Read(buf1, 0, buf1.Length)) > 0)
             {
-                is2.Read(buf2, 0, len);
+                var numRead = is2.Read(buf2, 0, len); // LUCENENET specific - 
asserting that we read the entire buffer
+                Assert.AreEqual(len, numRead);
+
                 for (int i = 0; i < len; i++)
                 {
                     Assert.AreEqual(buf1[i], buf2[i]);
@@ -254,7 +256,9 @@ namespace Lucene.Net.Util
             Stream is2 = sorted;
             while ((len = is1.Read(buf1, 0, buf1.Length)) > 0)
             {
-                is2.Read(buf2, 0, len);
+                var numRead = is2.Read(buf2, 0, len); // LUCENENET specific - 
asserting that we read the entire buffer
+                Assert.AreEqual(len, numRead);
+
                 for (int i = 0; i < len; i++)
                 {
                     Assert.AreEqual(buf1[i], buf2[i]);
diff --git 
a/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj
 
b/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj
index a631150c1..64220be37 100644
--- 
a/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj
+++ 
b/src/dotnet/Lucene.Net.CodeAnalysis.CSharp/Lucene.Net.CodeAnalysis.CSharp.csproj
@@ -24,9 +24,11 @@
   <PropertyGroup>
     <TargetFramework>netstandard1.3</TargetFramework>
     <IncludeBuildOutput>false</IncludeBuildOutput>
+
+    <!-- netstandard1.3 is required for Visual Studio 2017 compatibility -->
+    
<CheckNotRecommendedTargetFramework>false</CheckNotRecommendedTargetFramework>
   </PropertyGroup>
 
-  
   <Import Project="..\Lucene.Net.CodeAnalysis\Version.props" />
 
   <ItemGroup>
diff --git 
a/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj
 
b/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj
index f76baceda..d24d8db3d 100644
--- 
a/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj
+++ 
b/src/dotnet/Lucene.Net.CodeAnalysis.VisualBasic/Lucene.Net.CodeAnalysis.VisualBasic.csproj
@@ -24,9 +24,12 @@
   <PropertyGroup>
     <TargetFramework>netstandard1.3</TargetFramework>
     <IncludeBuildOutput>false</IncludeBuildOutput>
+
+    <!-- netstandard1.3 is required for Visual Studio 2017 compatibility -->
+    
<CheckNotRecommendedTargetFramework>false</CheckNotRecommendedTargetFramework>
   </PropertyGroup>
 
-  
+
   <Import Project="..\Lucene.Net.CodeAnalysis\Version.props" />
 
   <ItemGroup>
diff --git 
a/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj 
b/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj
index 6c5e8e057..6af63c394 100644
--- 
a/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj
+++ 
b/src/dotnet/Lucene.Net.Tests.CodeAnalysis/Lucene.Net.Tests.CodeAnalysis.csproj
@@ -22,14 +22,14 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net8.0</TargetFramework>
+    <TargetFramework>net9.0</TargetFramework>
     <RootNamespace>Lucene.Net.CodeAnalysis</RootNamespace>
-    
+
     <IsPublishable>false</IsPublishable>
-    <IsPublishable Condition=" '$(TargetFramework)' == 'net8.0' 
">true</IsPublishable>
+    <IsPublishable Condition=" '$(TargetFramework)' == 'net9.0' 
">true</IsPublishable>
     <IsTestProject>true</IsTestProject>
   </PropertyGroup>
-  
+
   <Import Project="$(SolutionDir).build/TestReferences.Common.targets" />
 
   <ItemGroup>
diff --git a/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj 
b/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj
index 24e943dd0..fc62de828 100644
--- a/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj
+++ b/src/dotnet/tools/Lucene.Net.Tests.Cli/Lucene.Net.Tests.Cli.csproj
@@ -25,7 +25,7 @@
 
   <PropertyGroup>
     <!-- Allow specific target framework to flow in from 
TestTargetFrameworks.props -->
-    <TargetFrameworks Condition=" '$(TargetFramework)' == '' 
">net8.0</TargetFrameworks>
+    <TargetFrameworks Condition=" '$(TargetFramework)' == '' 
">net9.0;net8.0</TargetFrameworks>
     <AssemblyTitle>Lucene.Net.Tests.Cli</AssemblyTitle>
   </PropertyGroup>
 

Reply via email to