Skip to content

Conversation

@paulirwin
Copy link
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Add .NET 10 target

Fixes #1219

@paulirwin paulirwin added the notes:new-feature A new feature label Nov 22, 2025
@paulirwin paulirwin marked this pull request as draft November 22, 2025 04:49
@paulirwin
Copy link
Contributor Author

Note that this PR reverts the hardcoded .NET 9 SDK since a new version is out that resolves that issue.

<TargetFrameworks>net8.0</TargetFrameworks>
<RollForward Condition=" $(TargetFramework.StartsWith('net8.')) ">Major</RollForward>
<TargetFrameworks>net10.0;net9.0;net8.0</TargetFrameworks>
<RollForward>Major</RollForward>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this to be conditional, since we should only roll forward from the highest version we support to any future version of .NET.

Technically, we could do it this way, but this is the largest package by far and packing up net9.0 (with only 6 months of support left) seems like a non-starter. So, IMO, we should remove net9.0 and make both net8.0 and net10.0 roll forward to future versions, which would include net9.0 rolled forward from net8.0.

<TargetFrameworks>net10.0;net8.0</TargetFrameworks>
<RollForward Condition=" $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net10.')) ">Major</RollForward>


<IsPublishable>false</IsPublishable>
<IsPublishable Condition="'$(TargetFramework)' == 'net8.0'">true</IsPublishable>
<IsPublishable>true</IsPublishable>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we publish on .NET Framework for the solution, this must be conditional, since .NET Tools only work on .NET Core.

<IsPublishable Condition="' $(TargetFramework.StartsWith('net8.')) Or $(TargetFramework.StartsWith('net10.')) '">true</IsPublishable>


<PropertyGroup>
<LangVersion>11.0</LangVersion>
<LangVersion>14.0</LangVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically, we only bump LangVersion if we need features from the language due to the knock-on effects that it could create. And we wouldn't need to rename all of the field fields in this PR.

Let's split this out into a separate issue if we need to do it at all.

One issue with this is that it immediately means that the latest tooling is required that supports .NET 10 to work on Lucene.NET. IMO, it would be better for contributors if we supported VS2022/.NET8/.NET9 so we don't leave contributors that may not have the time or space to install new tools behind. We can do this by staying on an older LangVersion and making the net10.0 target conditional depending on the version of Visual Studio installed. This should be fine because issues on a specific TFM are rare and any issues that arise would be caught by CI.

An example of this approach can be found in ICU4N:

    <TargetFrameworks Condition="$(VisualStudioVersion) &gt;= 16.10">net9.0;net8.0</TargetFrameworks>
    <TargetFrameworks>$(TargetFrameworks);netstandard2.0;net462;net451;net40</TargetFrameworks>

At one point, I think we had net6.0 requiring $(VisualStudioVersion) &gt;= 16.10 and net5.0 always enabled. We can do something similar using the condition $(VisualStudioVersion) &gt;= 18.0 for net10.0 now.

Of course, there is another level to this in the tests, since we only compile the .NET Framework tests on Windows.

    <TargetFrameworks Condition=" '$(TestFrameworks)' == 'true' AND $([MSBuild]::IsOsPlatform('Windows')) ">$(TargetFrameworks);net48;net472</TargetFrameworks>

And in the case of Lucene.NET, we only have it defaulted to run tests for a single target framework, so that would need to be conditional depending on the tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:new-feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .NET 10 target

2 participants