Skip to content

C#: Use .NET 11 to build the extractor. - #23161

Open
michaelnebel wants to merge 12 commits into
github:mainfrom
michaelnebel:csharp/dotnet11build
Open

michaelnebel wants to merge 12 commits into
github:mainfrom
michaelnebel:csharp/dotnet11build

Conversation

@michaelnebel

@michaelnebel michaelnebel commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Updating the build to use .NET 11 to build the extractor and also set the target framework for the extractor to .NET 11.

Notes.

  • Using a commit from rules_dotnet which removes the requirement that only a hardcoded list of .NET versions are supported.
  • CoPilot re-wrote the patch that we apply and it claims that it is semantically equivalent to the previous patch. It doesn't look like something we can upstream.
  • CoPilot also figured out that the new version of rules_dotnet removed @rules_dotnet//tools/paket2bazel and instead reads the paket.lock file directly. CoPilot provided the update to the build and update the update_deps.sh script.

@github-actions github-actions Bot added the C# label Nov 18, 2026
@michaelnebel
michaelnebel force-pushed the csharp/dotnet11build branch 5 times, most recently from 7110c7e to 882b835 Compare November 19, 2026 09:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The .NET 11 migration leaves stub generation pinned to an incompatible .NET 10 SDK and debugger launch paths pointing to net10.0 outputs, breaking stub workflows and launching missing or stale binaries.

2 open issues
What changed in this PR

Migrates the C# extractor build and target framework to .NET 11, including packaging, CI, and the default SDK used for build-mode-none analysis.

Changes:

  • Aligns SDK, runtime, and target-framework settings with .NET 11.
  • Updates rules_dotnet and Paket integration to consume the lockfile directly, removing generated Bazel dependency definitions.
  • Updates test expectations and adds a change note for the new default SDK.
File Description
MODULE.bazel Pins updated rules_dotnet, selects .NET 11, and enables direct Paket parsing.
misc/​bazel/​registry/​modules/​rules_dotnet/​metadata.json Removes obsolete local registry metadata.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.22.2-codeql.1/​source.json Removes the previous release source configuration.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.22.2-codeql.1/​patches/​revert_additional_files_in_nuget_archive.patch Removes the old NuGet archive patch.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.22.2-codeql.1/​patches/​module_dot_bazel_version.patch Removes the obsolete module-version patch.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.22.2-codeql.1/​MODULE.bazel Removes the previous registry module definition.
misc/​bazel/​patches/​rules_dotnet_nuget_archive.patch Adds the adapted NuGet archive filtering patch.
misc/​bazel/​patches/​BUILD.bazel Exports the replacement patch.
misc/​bazel/​csharp.bzl Targets .NET 11 in Bazel builds.
csharp/​update-deps.sh Removes the obsolete paket2bazel generation step.
csharp/​scripts/​gen-assembly-info.py Emits .NET 11 target-framework metadata.
csharp/​scripts/​create-extractor-pack.sh Publishes with runtime version 11.0.0.
csharp/​ql/​test/​utils/​modeleditor/​ApplicationModeEndpoints.expected Updates expected assembly versions.
csharp/​ql/​test/​library-tests/​dispatch/​viableCallable.expected Adds expected decimal-type operator candidates.
csharp/​ql/​test/​library-tests/​conversion/​operator/​Operator.expected Adds expected numeric conversions.
csharp/​ql/​test/​library-tests/​assemblies/​compilation.expected Updates expected framework assembly versions.
csharp/​ql/​lib/​change-notes/​2026-11-19-bmn-net11.md Documents the build-mode-none default SDK change.
csharp/​ql/​integration-tests/​posix/​standalone_dependencies_executing_runtime/​Assemblies.expected Updates expected bundled assemblies.
csharp/​paket.main.bzl Removes generated NuGet repository definitions.
csharp/​paket.main_extension.bzl Removes the generated Paket module extension.
csharp/​paket.lock Updates framework restriction and dependency edges.
csharp/​paket.dependencies Restricts dependencies to .NET 11.
csharp/​extractor/​Semmle.Extraction.CSharp.DependencyStubGenerator/​Semmle.Extraction.CSharp.DependencyStubGenerator.csproj Retargets the stub generator to .NET 11.
csharp/​extractor/​Semmle.Extraction.CSharp.DependencyFetching/​DotNet.cs Sets the default SDK to 11.0.100.
csharp/​Directory.Build.props Sets the shared target framework to .NET 11.
csharp/​BUILD.bazel Exports Paket inputs for direct parsing.
csharp/​actions/​create-extractor-pack/​action.yml Installs SDK 11.0.100 for packaging.
csharp/​.paket/​Paket.Restore.targets Updates Paket discovery, restore caching, and packing integration.
csharp/​.config/​dotnet-tools.json Upgrades Paket to 12.0.0.
.github/​workflows/​csharp-qltest.yml Updates CI SDK and test runtime versions.
.github/​workflows/​codeql-analysis.yml Selects SDK 11.0.100 for analysis.
.gitattributes Removes entries for deleted generated Bazel files.

Review effort: Balanced (adaptive)

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am doing a follow up PR for updating the stub generator script and all the tests to target .NET 11: #23172


<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair point, I will add that on the follow up PR as well.

@michaelnebel
michaelnebel marked this pull request as ready for review November 20, 2026 08:16
@michaelnebel
michaelnebel requested review from a team as code owners November 20, 2026 08:16

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants