Suppress warnings on "Use collection initializer"


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.

Comment actions Permalink
Official comment

Hello Dorothy,

Please use the following comment to disable it with comment:

// ReSharper disable once UseObjectOrCollectionInitializer


Comment actions Permalink

Hi Alexander, thanks so much for this!


Please sign in to leave a comment.