You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have assembly A and assembly B, with B referencing A.
Assembly A declares [assembly: InternalsVisibleTo("B")]. Both assemblies make use of [AutoConstructor].
You'll get this warning when compiling assembly B:
warning CS0436: The type 'AutoConstructorAttribute' in 'AutoConstructor.Generator\AutoConstructor.Generator.AutoConstructorGenerator\AutoConstructorAttribute.cs' conflicts with the imported type 'AutoConstructorAttribute' in 'A, Version=1.2.3.4, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'AutoConstructor.Generator\AutoConstructor.Generator.AutoConstructorGenerator\AutoConstructorAttribute.cs'.
I compile with warnings-as-errors so this actually prevents me from compiling. Thankfully you can suppress this warning, which also prevents it from turning into an error, via .editorconfig (or elsewhere) and then the compiler is happy:
# CS0436: Type conflicts with imported type
# Ensures that per-assembly source-generated attributes, e.g. [AutoConstructor], will not raise errors
dotnet_diagnostic.CS0436.severity = none
@Sergio0694 just fixed this exact issue in a new generator by emitting the suppression automatically and only for the type in question.
The text was updated successfully, but these errors were encountered:
Let's say you have assembly A and assembly B, with B referencing A.
Assembly A declares
[assembly: InternalsVisibleTo("B")]
. Both assemblies make use of[AutoConstructor]
.You'll get this warning when compiling assembly B:
I compile with warnings-as-errors so this actually prevents me from compiling. Thankfully you can suppress this warning, which also prevents it from turning into an error, via
.editorconfig
(or elsewhere) and then the compiler is happy:@Sergio0694 just fixed this exact issue in a new generator by emitting the suppression automatically and only for the type in question.
The text was updated successfully, but these errors were encountered: