You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently planning to move Roslyn.sln to dogfood the latest analyzers package that has couple of DFA based dispose rules. More specifically we are enabling the following rules:
CA2000 (Dispose objects before losing scope): A local object of a IDisposable type is created but the object is not disposed before all references to the object are out of scope.
CA2213 (Disposable fields should be disposed): A type that implements System.IDisposable declares fields that are of types that also implement IDisposable. The Dispose method of the field is not called by the Dispose method of the declaring type.
A disposable object created in a method body, which is not saved into an instance field and/or escaped via either calling into an external library or returned by the method, must be disposed in a method. If assigned to a field of a disposable object, then the Dispose/DisposeBool/Close method (or call graph rooted at this method) of the containing type must dispose the field. If escaped via returning the disposable object, then the caller takes over the ownership to dispose the object.
These rules have large number of violations in non-shipping projects. These are either real dispose leaks that need to be fixed or false positives that must be suppressed. For now, we are disabling this rule in the non-shippin projects by adding entries to NonShippingProject_BuildRules.ruleset. This issue tracks removing these ruleset entries, and fixing/suppressing the dispose violations in non-shipping projects.
The text was updated successfully, but these errors were encountered:
We are currently planning to move Roslyn.sln to dogfood the latest analyzers package that has couple of DFA based dispose rules. More specifically we are enabling the following rules:
A disposable object created in a method body, which is not saved into an instance field and/or escaped via either calling into an external library or returned by the method, must be disposed in a method. If assigned to a field of a disposable object, then the Dispose/DisposeBool/Close method (or call graph rooted at this method) of the containing type must dispose the field. If escaped via returning the disposable object, then the caller takes over the ownership to dispose the object.
These rules have large number of violations in non-shipping projects. These are either real dispose leaks that need to be fixed or false positives that must be suppressed. For now, we are disabling this rule in the non-shippin projects by adding entries to NonShippingProject_BuildRules.ruleset. This issue tracks removing these ruleset entries, and fixing/suppressing the dispose violations in non-shipping projects.
The text was updated successfully, but these errors were encountered: