开发者

WPF Application: Microsoft.Maintainability#CA1506 Signature is not valid FxCop violation

I have a WPF solution, and when I run FxCop on it (well, when I build it with Code Analysis enabled, to be precise), with the rule set set to Microsoft All Rules (there are a few other rule sets that do this, as well), it gives me the following error:

CA0001: Rule=Microsoft.Maintainability#CA1506, Target=My.Project.Namespace.App : Signature is not valid.

This seems to refer to the Application subclass that is my application's entry point. No开发者_StackOverflow中文版thing seems to be invalid about the class signature, as far as I can tell. Googling the error brought up some other CA0001/CA1506 violations, but nothing specifically regarding the "Signature is not valid." error (CA1506 seems to be "Avoid excessive class coupling", although I found someone with my kind of error but with "Collection was modified during enumeration"; neither that nor my error seem to have anything to do with excessive coupling).


According to the CA001 documentation, this error is caused by a defect in a custom rule or an unknown defect in the managed code analysis tool. It sounds like the error is reporting that the code analysis engine is unable to load/execute the CA1506 rule due to an invalid signature, but since you are using the standard Microsoft rule sets this seems to be a puzzling error.

The MSDN documentation suggests you try the following:

  • For more diagnostic information, view the CodeAnalysisReport.xml in the \obj folder. The report lists the exception type, stack, type, message, and stack of all inner exceptions.
  • Try rewriting the line where the error is reported, or several lines of code surrounding that line.

If an examination of the code ananlysis report does not yield additional information, you may want to check your development environment to see if there is an issue with the way code analysis is configured within Visual Studio. You might even try to do a repair on Visual Studio.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜