BADF00D / DisposableFixer

This is a Visual Studio Extension and NuGet package that should identify and fix problems as memleaks while using IDisposables.
Other
35 stars 7 forks source link

No code fix for Using declarations #147

Closed Thaoden closed 4 years ago

Thaoden commented 4 years ago

Prerequisites

Description

When accessing code fixes for DF0010 "Local variable is not disposed", only "Dispose after last usage", "Create field and dispose in Dispose() method", and "Wrap in using" are offered. "Use Using declaration" or something similar would be a nice addition to the list.

Source Code

private void MyMethod(){
    var msg = new HttpResponseMessage();
}

Screenshot

Disposable

BADF00D commented 4 years ago

Your are right, that would be nice. Thanks you for suggesting this feature

BADF00D commented 4 years ago

There are two new code fixes available:

Will be part of release 3.3.0 (just released). Happy coding!