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
{{ message }}
Repository navigation
[RequiresThreadSafe] cannot be used: PS0171 on its own MulticastAttributeUsage #335
error PS0171: Error in MulticastAttributeUsage applied on type 'PostSharp.Patterns.Threading.RequiresThreadSafeAttribute': strict attribute inheritance is not supported on properties and events.
error PS0055: The processing of multicast attributes cannot continue because of the previous errors.
Seen with 2027.0.7 (local build). The cause is in the attribute itself, so all versions are affected.
MulticastAttributeTask rejects Inheritance = Strict on any attribute whose valid targets include Property or Event (PS0171). This check and this declaration both date from 2014. Nothing in the repository applies the attribute or tests it.
Fix
Remove Inheritance = MulticastInheritance.Strict, or remove MulticastTargets.Property from the valid targets, and add a test that applies the attribute to a field, a property and a parameter. The documentation section about the attribute was removed from postsharp/PostSharp.Documentation#58 until it works; restore it with the fix.
There is a conceptual issue. I think the correct behavior is to report the error only when the attribute is applied to an invalid target, not when we validate the attribute itself. Any other fix breaks backward compatibility.
Activity
gfraiteur commentedon Oct 28, 2026
There is a conceptual issue. I think the correct behavior is to report the error only when the attribute is applied to an invalid target, not when we validate the attribute itself. Any other fix breaks backward compatibility.