Skip to content

Verify the ahead-of-time compiled dotnet CLI entry point #96

Description

The .NET 11 command-line interface serves its command surface from an ahead-of-time compiled path,
out of process.

Verify that PostSharp's command-line tooling, and any build step that invokes dotnet, still behave
correctly.

Analysis: Documentation/DotNet11-CSharp15-Impact.md in postsharp/PostSharp.

— Claude for Gael

Activity

  1. gfraiteur commented on Oct 10, 2026

    @gfraiteur
    MemberAuthor

    Result: no defect found

    Verified on 2026-10-10 against SDK 11.0.100-rc.1.26425.128 on Windows x64, with host tracing (COREHOST_TRACE). That SDK is the one the repository's global.json pins.

    Note: the analysis cited above, Documentation/DotNet11-CSharp15-Impact.md, does not exist in any branch of postsharp/PostSharp. These findings are recorded here instead.

    What the .NET 11 SDK changes (measured)

    • The SDK directory ships dotnet-aot.dll, a native library. It sits beside the managed dotnet.dll, dotnet.deps.json and dotnet.runtimeconfig.json, which are all still present.
    • The host loads dotnet-aot.dll ("Using AOT-ed SDK") for --version, --info, restore, msbuild and tool commands.
      • For the MSBuild-based commands, it then initializes the managed sdk/dotnet.dll in the same process.
      • It starts a .NET tool as a child process: dotnet.exe <tool>.dll.
    • The host answers --list-sdks, --list-runtimes, exec and dotnet <app>.dll itself, without the SDK. These do not change.
    • dotnet --version with an empty DOTNET_CLI_HOME writes only the version to standard output. No first-run text appears.

    PostSharp call sites

    Call site Command Result
    BuildClient dotnet exec --roll-forward … PostSharp.Compiler.Hosting…dll Host only, unchanged
    NetCoreResolver --version AOT entry point; output parses (measured)
    NetCoreResolver --list-sdks, --list-runtimes Host only, unchanged
    NetCoreResolver reads <sdk>/dotnet.runtimeconfig.json File present. This is the assumption most exposed to a future SDK, so it is now covered by a test (below)
    BuildToolsHelper dotnet --roll-forward-on-no-candidate-fx 2 Unzipper.dll Host app mode, unchanged
    BuildTimeDependencyRestorer dotnet restore (child process) AOT front end, then managed SDK; covered by CI
    NativeImageManager dotnet msbuild (crossgen discovery) AOT front end, then managed SDK; covered by CI
    MemoryThrottler dotnet build-server shutdown --vbcscompiler --razor Both options still accepted (measured)

    The postsharp .NET tool (measured)

    I installed the local build 2027.0.3.1152 in a tool manifest:

    • dotnet postsharp --help, dotnet tool run postsharp -- --help, dotnet postsharp version and dotnet postsharp telemetry --help all work through the AOT front end.
    • The front end starts the tool as dotnet.exe …/PostSharp.Tool.dll. It runs on runtime 10.0.12 (RollForward=Major).
    • Exit codes match a direct dotnet PostSharp.Tool.dll: 0 on success, -1 for an unknown command.
    • The tool states its process kind (ProcessKind.DotNetTool) instead of detecting it from the process name. Running under dotnet.exe in a child process therefore changes nothing for Backstage.
    • I did not run shutdown, kill or cleanup: they would have stopped the build servers of the machine.

    End to end (CI)

    All develop/2027.0 builds since 2026-09-25 use the SDK 11 RC1 that global.json pins (#93).

    • ReleaseCheckMinimalQualityRequirements 343403 (ab0b774e3e) and 343485 (600bd383d2) passed.
    • The cells of ReleaseRunAllNet110Tests 343374 passed. These include Linux x64 and Linux ARM64 (CrossPlatform). They exercise the dependency restore, dotnet exec of the compiler, tool extraction and ReadyToRun on SDK 11.
    • In ReleaseCheckAllQualityRequirements 343404, two cells failed for reasons unrelated to the CLI: a macOS agent failed to start, and the PostSharp.Patterns.Model backward-compatibility check failed.

    Inferred, not measured: I ran the host trace on Windows only. On Linux, the behaviour above is inferred from the green Linux cells.

    Regression guard

    postsharp/PostSharp#219 adds a test that runs NetCoreResolver against the installed CLI: --version, --list-sdks, --list-runtimes, and the runtime that dotnet.runtimeconfig.json selects. Until now, every resolver test faked the CLI. The new test passes locally against SDK 11 RC1.

    -- Claude for Gael

  2. gfraiteur commented on Oct 14, 2026

    @gfraiteur
    MemberAuthor

    Released in PostSharp 2027.0.4-preview.

    -- Claude for Gael

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-PlatformsTarget frameworks, SDKs, reference packs, languages

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions