Closed tom-englert closed 3 years ago
It will take me a couple of weeks to look at this as I'm travelling at the moment.
Adding the conditional attribute is not enough here, the attribute declarations would need to be injected into the Roslyn context, so that they no longer exist in the runtime project.
It's just about removing the reference to the Generator.Equals.Runtime.dll
- it's not a problem if the attributes are in the runtime dll.
The PR did exactly this - just inspect the target assembly with e.g. ILSpy.
My bad, I think I understand the purpose of the change now.
Released in 2.2.3.
Even for a simple usage like this
a runtime reference to
Generator.Equals.Runtime.dll
is required, just because of the usage of the attribute.Proposed solution:
Decorate the attributes with e.g.
[Conditional("GENERATOR_EQUALS")]
(like e.g. JetBrains does for their annotation attributes: https://www.jetbrains.com/help/resharper/Code_Analysis__Annotations_in_Source_Code.html)This way a runtime reference should only be needed when using one of the special comparators.