Skip to content

[Question] Does trim analyzer emit warnings for the inaccessible code? #3239

@voroninp

Description

@voroninp

I want to share data contracts between backend and frontend, including API definition.

I use Refit and I see it generates private classes which are not used in assembly anywhere. These classes are instantiated with reflection. So there's no chance they are going to be ever rooted by static code.

When I set data contract library as trim compatible my BlazorWasm application fails to start because Refit cannot find the generated implementation. Obviously 🤣

Should not linker produce a warning when it detects an isolated set of private dependencies which are 100% will be inaccessible by any non-reflection code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions