Skip to content

Trimmed publish tests fail on IL3050 AOT analyzer warnings #2801

Description

@Widthdom

Summary

On current origin/main, full dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj reaches the trimmed publish tests and fails because the test-internal dotnet publish treats IL3050 AOT analyzer diagnostics as errors.

Observed failing test:

  • CodeIndex.Tests.QueryCommandRunnerTests.RunPublishedTrimmedCli_SerializesQueryJsonAndErrorJson

Representative diagnostics include ActiveWorkspace.cs, WorkspaceCommandRunner.cs, CdidxConfigFile.cs, SuggestionStore.cs, McpServer.cs, and other JSON serialization call sites using APIs annotated with RequiresDynamicCodeAttribute.

Repro

dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj /p:WarningsNotAsErrors=IL2026%3BIL2067%3BIL2072%3BIL2075%3BIL3050

The outer test build can be made to continue by demoting IL3050, but the test-internal trimmed dotnet publish still fails on IL3050.

Notes

This was found while validating unrelated issue fixes and is not part of that implementation scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions