Disabling/Fixing Code Analysis warnings from .Designer.cs files

后端 未结 4 1413
忘了有多久
忘了有多久 2021-02-13 14:44

I am using DataVisualization.Charting.Chart extensively, and for the most part it is working. However, I\'ve been running Code Analysis frequently, and have all my

4条回答
  •  梦谈多话
    2021-02-13 15:41

    A fair few developers appear to have encountered this without a luck, so +1 for a good question!

    A possible solution is to write a method that override's CA2000 and suppresses the rule if the warning is detected in a designer file, here's a good start:

    Writing Custom Code Analysis Rules in Visual Studio 2010

    Otherwise see the comments at the end of this thread, MSFT engineers mention to log a Connect call: http://blogs.msdn.com/b/codeanalysis/archive/2010/03/22/what-s-new-in-code-analysis-for-visual-studio-2010.aspx

提交回复
热议问题