Skip to content

Transitive analyzers cause conflicts when strict deps are disabled #443

@sin-ack

Description

@sin-ack

There is a simplistic check to elide assemblies when they are already present, but the same isn't done for analyzers:
https://github.com/bazelbuild/rules_dotnet/blob/626e28effb14f87de8375186ebb59911a16b71fb/dotnet/private/common.bzl#L315

I ended up having the following compile flags passed down:

/analyzer:external/_main~main_extension~nuget.microsoft.extensions.configuration.binder.v8.0.1/analyzers/dotnet/cs/Microsoft.Extensions.Configuration.Binder.SourceGeneration.dll
...
/analyzer:external/rules_dotnet~~targeting_packs_extension~nuget.microsoft.aspnetcore.app.ref.v8.0.3/analyzers/dotnet/cs/Microsoft.Extensions.Configuration.Binder.SourceGeneration.dll

Which gives me the following compile error:

Microsoft.Extensions.Configuration.Binder.SourceGeneration/Microsoft.Extensions.Configuration.Binder.SourceGeneration.ConfigurationBindingGenerator/BindingExtensions.g.cs(40,10): error CS0433: The type 'InterceptsLocationAttribute' exists in both 'Server, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Server, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
Microsoft.Extensions.Configuration.Binder.SourceGeneration/Microsoft.Extensions.Configuration.Binder.SourceGeneration.ConfigurationBindingGenerator/BindingExtensions.g.cs(40,10): error CS0433: The type 'InterceptsLocationAttribute' exists in both 'Server, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Server, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

Should the same transitive check be added for analyzers?

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