I started using the new Code Analysis feature of VSTS today, moving from external FxCop usage. A cool thing about this new feature is that is adds supression information directly to the source code in the form of attributes.
I like this since it keeps the supressions with the code. There is one drawback for us at Digipede: we cross compile back to .NET 1.1. These new attributes don’t exist in the old framework, so I added my own for compilation with our .NET 1.1 code:
namespace System.Diagnostics.CodeAnalysis {
[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
internal class SuppressMessageAttribute : Attribute {
public SuppressMessageAttribute(string category, string checkId) {}
public string Category { get { return null;} set {} }
public string CheckId { get { return null;} set {} }
public string Justification { get { return null;} set {} }
public string MessageId { get { return null;} set {} }
public string Scope { get { return null;} set {} }
public string Target { get { return null;} set {} }
}
}
Thanks to The Moth for part of the implementation. He blogs about the attribute not being included in the Compact Framework here: SuppressMessage not in CF.






Main feed
Email subscriptions