Skip to content

Prevent analyzer for transitive dependencies #170

@latop2604

Description

@latop2604

Describe the bug

When adding Dapper.Aot on a project A, all project referencing project A will have the Dapper.aot analyzer enable and trigger the DAP001 on them.

I tried to play with PrivateAssets attribute of PackageReference but does not seem to work. Using PrivateAssets.All fail at runtime because the generated code use method defined in Dapper.Aot.dll

Where are you seeing this?

  • Dapper.Aot 1.0.48

To Reproduce
See screenshot

Expected behavior
Have a way to not leak roslyn analyzer as transitive dependency.
I want to use the source generator in my lib. But not in other app that use my nuget package

Screenshots

Image

Additional context
Dapper.Aot have been added to Hangfire.Postgres lib. But some people can use it as it enable Dapper.Aot in their app when referencing HF.PG nuget package

hangfire-postgres/Hangfire.PostgreSql#416

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