Skip to content

Commit 1cbc948

Browse files
committed
Add CA2000: Dispose objects before losing scopes
1 parent 1c587b2 commit 1cbc948

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ and adheres to a project-specific [Versioning](/README.md).
3232
- S4545: "DebuggerDisplayAttribute" strings should reference existing members
3333
- S4663: Comments should not be empty
3434
- S5856: Regular expressions should be syntactically valid
35+
- CA2000: Dispose objects before losing scopes
3536

3637
### Removed
3738

build/Neolution.CodeAnalysis.globalconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ dotnet_diagnostic.S3257.severity = suggestion
246246
; This can be an annoying rule in cases where it does not really improve readability or even worsens it.
247247
dotnet_diagnostic.S3267.severity = suggestion
248248

249+
# CA2000: Dispose objects before losing scopes
250+
; Developers should be warned when they create disposable objects without disposing them
251+
dotnet_diagnostic.CA2000.severity = warning
252+
249253
# S107: Methods should not have too many parameters
250254
dotnet_diagnostic.S107.severity = warning
251255

0 commit comments

Comments
 (0)