Suppress warnings on "Use collection initializer"

Answered

I would like to suppress warnings on "Use collection initializer" in places where extension methods are used to initialize the objects. I tried to look up the inspection alias for this warning for the ReSharper disable option (i.e. ReSharper disable once [inspection alias]), but I have not been able to find an inspection alias for this warning. This warning does not show up locally even though I have increased the severity level of code inspection for this warning from the default "Suggestion" to "Warning". It shows up on the CI build. Locally I am using ReSharper 10.0.2 and so is the Team City CI build we have set up here. If anyone has an idea on how to suppress this warning please let me know. Thank you.

2 comments
Comment actions Permalink
Official comment

Hello Dorothy,

Please use the following comment to disable it with comment:

// ReSharper disable once UseObjectOrCollectionInitializer

Thanks!  

Comment actions Permalink

Hi Alexander, thanks so much for this!

0

Please sign in to leave a comment.