3

Consider this code:

 protected override void Dispose(bool disposing)
 {
     if (disposed)
         return;

     if (disposing)
     {
         activeFile?.Dispose();
         ...

FxCop is identifying this as "CA2213:DisposableFieldsShouldBeDisposed" (for activeFile) because it doesn't seem to understand the ?. operator.

Is there a known minimum version of FxCop that accepts this?

Thanks!

Brad
  • 3,190
  • 1
  • 22
  • 36
  • See https://github.com/dotnet/roslyn-analyzers/issues/291 and https://github.com/dotnet/roslyn/issues/4830 . – mjwills Jul 08 '17 at 02:57
  • FxCop in general is obsolete. As the other comments suggest, you should find alternatives. – Lex Li Jul 08 '17 at 04:07

0 Answers0