具有以下带有泛型类型参数属性的C#代码:
[System.AttributeUsage(System.AttributeTargets.GenericParameter)]
public class GenericParameterAttribute : System.Attribute
{
}
public class GenericClass<[GenericParameter] T>
{
}
打开StyleCop集成(在.csproj文件中导入StyleCop.targets) StyleCop返回错误并且编译失败:
错误1 SA0102:CSharp.CsParser:在文件中发现语法错误...
没有在.csproj文件中导入的StyleCop.targets编译好了。
环境
- StyleCop版本4.7.47.0(最新版本可从 http://stylecop.codeplex.com/releases/view/79972)
- .NET Framework 4.0
我在StyleCop文档站点上找不到代码SA0102 http://www.stylecop.com/docs/StyleCop%20Rules.html - 似乎SA0102不是StyleCop规则,可能是内部StyleCop错误的代码。
那么问题:如何压制StyleCop错误SA0102?