mar*_*ark 5 .net c# cls-compliant
我有一些代码,它会在几个地方生成此警告.我想修复它们,但我不知道它们在哪里,因为C#编译器没有报告错误行(有一个打开的MS Connect问题).
有没有工具,可以告诉我有问题的代码在哪里?IL级工具很好,已知方法名称和声明类型足够好.
你已经声明了一个类:
[SomeAttribute(new string[] { "foo", "bar" })
class SomeClass { }
Run Code Online (Sandbox Code Playgroud)
或者已经声明了一个属性,例如:
class SomeAttribute : Attribute
{
public SomeAttribute(string[] arr) { } // or another array
}
Run Code Online (Sandbox Code Playgroud)
所有这一切的发生是因为您的程序集被标记为 CLSCompliant:
[assembly:CLSCompliant(true)]