net_automatic_interface icon indicating copy to clipboard operation
net_automatic_interface copied to clipboard

GenerateAutomaticInterface attribute

Open konrad-gora opened this issue 1 year ago • 4 comments

to use this package we need to create the GenerateAutomaticInterface attribute manually. Could this attribute be generated, like interfaces?

This package https://github.com/daver32/InterfaceGenerator (inspired by yours) generates the attribute.

konrad-gora avatar Feb 09 '24 17:02 konrad-gora

Interesting Idea, I will look into it.

ChristianSauer avatar Feb 12 '24 08:02 ChristianSauer

I believe that attributes should be provided in separate nuget package to avoid problems with InternalsVisibleTo. Please take a look on that: https://andrewlock.net/creating-a-source-generator-part-7-solving-the-source-generator-marker-attribute-problem-part1/

Hau-Hau avatar Feb 26 '24 16:02 Hau-Hau

The RegisterPostInitializationOutput option is neat, but as @Hau-Hau wrote can break things. Requiring another dependency just for that gets you into the "which one do I have to reference for the thing to work"... The "conditionally generate, depending on user settings, and have another package for breaking cases" is somewhat complex for a pretty trivial marker interface. Just my 2ct.

anotherthomas avatar Mar 21 '24 06:03 anotherthomas

IMO just adding in a description of the additional package that contains only the attribute and the "main" package should be referenced would be enough. Also, additional features could be considered that need attribute to be extended. Adding more properties to the attribute would be easier than asking users to do it themselves. (like InterfaceName or AccessModifier) There could be another attribute to mark methods/properties that we don't want to add to the interface.

konrad-gora avatar Mar 29 '24 20:03 konrad-gora

Fixed in 3.0.0

ChristianSauer avatar Aug 11 '24 08:08 ChristianSauer