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

后端 未结 4 1407
忘了有多久
忘了有多久 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:47

    Simply add a [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed", MessageId = "..."] to the Dispose method in your *.Designer.cs file.

    I just did, and I've found out that VS 2012 is clever enough to keep it there even when rewriting the file when something was changed in the designer.

提交回复
热议问题