如何抑制整个类型的 FxCop 警告?
namespace ConsoleApplication1
{
public static class Serializer<T>
{
public static string Serialize(T obj)
{
return string.Empty;
}
public static T Deserialize(string str)
{
return default(T);
}
}
我试过这个,但它不适合我:
[assembly: SuppressMessage("Microsoft.Design",
"CA1000:DoNotDeclareStaticMembersOnGenericTypes", Scope = "Type",
Target = "ConsoleApplication1.Serializer'1")]