I am developing some async code using Web Api, and I get a lot of FxCop errors that I would like to suppress. For example the following code in my controller would trigger these errors:
- UsePropertiesWhereAppropriate
- MarkMembersAsStatic
- DoNotNestGenericTypesInMemberSignatures
public Task<HttpResponseMessage<IEnumerable<Foo>>> GetAsync() { }
I do not want to suppress these rules for the whole assembly, so it seems like the only way to suppress the errors in code is to add a SuppressMessage
attribute for each violated rule on each method. Is there a better way to suppress the errors? I am thinking of custom FxCop rules... Is it possible to create a rule like "Ignore DoNotNestGenericTypesInMemberSignatures
for Task<T>
" or "Ignore these rules for any type inheriting from Bar class"?