I have an extension method which returns a value. In this case, it should set a specific bit in a byte:
public static byte SetBit(this byte b, int bitNumber,
There seems to be a Nuget Package for ReSharper Annotations.
This includes a MustUseReturnValueAttribute:
[MustUseReturnValue("Use the return value to...")] public byte Foo() { }
As @Kirk Woll pointed out in the comments, it is also possible to write a custom Roslyn Analyzer.