Rider claims attribute declaration errors where Unity sees none

Completed

As of Rider 2017.3.1, the IDE is complaining about a number of errors related to attribute usage, such as:

Attribute 'UnityEngine.AddComponentMenu' is not valid on this declaration type. It is valid on 'Class' declarations only.

The code in question belongs to a 3rd party package I'm using within Unity. Unity, however, complains of no such errors. I can "Ignore Errors" for t hese, but this setting appears to disappear when Rider restarts. It also appears to make Rider significantly less stable.

0
1 comment

This is fixed in Rider 2018.1 (currently in EAP, available here, or via the Toolbox App). The errors have been downgraded, and incorrect usage of various Unity attributes are now shown as "redundant" code - it's technically correct that the attributes can be applied here, but they do nothing.

See #322 and #325 on the GitHub repo for more details.

0

Please sign in to leave a comment.