Skip to content

AOT: annotate Spectre.Console.AnsiConsole.WriteException usage in AssertCommand #265

Description

@jeremydmiller

Surfaced by IsAotCompatible=true on Weasel.Core (landed in Weasel 9.0 foundation):

warning IL3050: Using member 'Spectre.Console.AnsiConsole.WriteException(Exception, ExceptionFormats)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. ExceptionFormatter is currently not supported for AOT.

Location: src/Weasel.Core/CommandLine/AssertCommand.cs:34

This is in a CLI command — dev-time tool, not production hot path. Per the JasperFx 2.0 cold-start/AOT pillar pattern, the fix is to annotate the consuming method (or class) with [RequiresDynamicCode] so the warning propagates to AOT-publishing consumers as a precise diagnostic rather than getting silently swallowed.

Tracked under pillar JasperFx/jasperfx#213.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions