Can Resharper be set to warn if IDisposable not handled correctly?

前端 未结 5 1432
醉话见心
醉话见心 2020-12-01 18:00

Is there a setting in Resharper 4 (or even Visual Studio itself...) that forces a warning if I forget to wrap code in a using block, or ommit the proper Dispose

5条回答
  •  自闭症患者
    2020-12-01 18:15

    See this blog post for some tricks for testing for Dispose() in DEBUG. Basically, write a DEBUG-only destructor that asserts that you were disposed.

提交回复
热议问题