Skip to content

.NET support

Ankus targets .NET 10 LTS by default. Extensions can also target .NET 11 (net11.0), which Ankus supports on the .NET 11.0.0 release; see .NET 11 status for what has been validated.

Ankus plans to support both LTS and STS .NET releases, starting with .NET 10. Each new major must pass Ankus’s native runtime and PostgreSQL validation before it is listed as supported. A successful managed build alone does not establish extension compatibility.

Once declared supported, a .NET major will remain serviced in a supported Ankus release line until that .NET major reaches Microsoft’s end of support. Use the latest servicing release of that Ankus line. Adding .NET 11 will not remove .NET 10 support or require existing extensions to retarget immediately.

As checked on October 14, 2026, Microsoft’s policy provides three years for LTS releases and two years for STS releases, with current patches required. .NET 10 support ends November 14, 2028. .NET 11 shipped on November 10, 2026, as an STS release with two years of support. A .NET release alone does not establish Ankus support. See the .NET support policy for current dates.

Ankus releases use their own version numbers independently of .NET. There is no planned .NET Framework, .NET Standard extension target, or backport to .NET 8/9. Ankus’s native runtime integration requires an explicitly supported modern .NET target. This is Ankus’s project support policy; Microsoft’s support does not cover Ankus’s runtime modifications.

SDK, target framework, and embedded runtime

Section titled “SDK, target framework, and embedded runtime”

These versions serve different purposes:

Selection What it controls
.NET SDK in global.json The build tools and C# compiler used by your project
TargetFramework, net10.0 or net11.0 The .NET API contract your extension compiles against, and which patched runtime it embeds
Ankus.Sdk package version Matching Ankus packages and the selected Native AOT compiler/runtime payload
PostgreSQL major and runtime identifier The server ABI, operating system, and architecture of the native library

Generated projects select stable .NET 10 SDKs with rollForward: latestFeature and allowPrerelease: false. A .NET 11 SDK can coexist for other projects without changing that selection. Installing a newer SDK does not retarget your extension or update its embedded runtime. ankus new --framework net11.0 (or the same template option) instead targets net11.0 and selects SDK 11.0.100 or a later stable .NET 11 SDK the same way. See .NET SDK selection.

An SDK 11 build of a net10.0 extension uses the .NET 10 compiler and embedded runtime. SDK 11 can publish Native AOT without a full build; Ankus keeps UseOptimizedPublish off unless your project turns it on, so an extension publishes through its full build on every SDK.

Ankus selects the matching runtime and compiler from your TargetFramework; extension authors do not build a runtime fork or override compiler internals. The command-line tool, native binding helper, and managed test host also need their declared .NET runtime on the development machine. The selected SDK’s compiler uses that SDK’s own runtime requirements. Installing a newer SDK does not replace the .NET 10 runtime required by Ankus’s managed tools. PostgreSQL servers do not need a separately installed .NET runtime.

The net11.0 runtime carries every Ankus runtime change, adapted where .NET 11 reorganized the collector, thread pool and diagnostics. On .NET 11.0.0 it passes the runtime’s own fork probes and, with every repository extension and the framework-template consumers targeting net11.0, the complete Ankus test suite on every supported PostgreSQL major, 13 through 19, on Linux x64, macOS ARM64, Windows x64 and Intel macOS, and on PostgreSQL 18 on Linux ARM64.

A net11.0 extension can use C# 15, including union types, closed hierarchies and collection expression arguments, and runtime async, which you turn on with <Features>runtime-async=on</Features>. PostgreSQL calls a function on its backend thread and waits for the result, so code that resumes after an await on a thread-pool thread must not use PostgreSQL APIs or Ankus values that belong to the backend thread.

Ankus includes a patched Native AOT runtime for PostgreSQL process and preload behavior. The SDK automatically restores a matching patched Native AOT compiler for the build machine and runtime for the extension’s target platform. These packages are versioned together, and each target framework has its own: a net11.0 extension embeds .NET 11’s runtime with the same patch, matching its .NET 11 compiler.

Ankus also selects the matching framework-library patch. Projects targeting an unsupported framework or overriding RuntimeFrameworkVersion to a different patch fail before publication. Update Ankus packages to service the embedded runtime; changing that property does not update Ankus’s patched runtime.

Native AOT embeds runtime code into the published library. Updating .NET on a server does not update an already published extension. See Microsoft’s Native AOT deployment documentation.

When Ankus ships a runtime servicing update:

  1. Update the pinned Ankus.Sdk and any explicitly referenced Ankus packages to the matching supported release, and update the build SDK as instructed by its release notes.
  2. Restore and republish the extension for every deployed PostgreSQL major and operating system/architecture. Test the resulting artifacts.
  3. Stop the PostgreSQL processes that loaded the old libraries before replacing them, then restart those processes. Shared-preload extensions require stopping and restarting PostgreSQL. Replacing a library on disk does not replace code already loaded into a backend.

A runtime patch update alone does not imply a SQL schema upgrade. Follow your extension’s upgrade instructions if its SQL or stored-data format also changes.