Current filter:
                                You should refresh the page.
                                  • Repro steps:
                                    0. Set your Local declaration style in Programming Style to Use implicit.

                                    1. Create a new C# Console App (.NET Framework) in Visual Studio 2017.  (We'll call it UsingImplicit.)
                                    2. Replace the code in the Program class with the following:
                                    [C#]
                                    using System; namespace UsingImplicit { class Program { class Whatever : IDisposable { public void Dispose() => throw new NotImplementedException(); } static void Main(string[] args) { new Whatever(); } } }
                                    3. Put your cursor on Whatever in the Main method.
                                    4. Activate the Introduce Using Statement refactoring.

                                    Expected:
                                    The code is refactored to:

                                    [C#]
                                    using (var whatever = new Whatever()) { }

                                    Actual:
                                    The code is refactored to:

                                    [C#]
                                    using (Whatever whatever = new Whatever()) { }
                                • Dmitry O (DevExpress) 01.17.2018

                                  Thank you for the code snippets. I have reproduced the problem on my side. I am absolutely agree that the "Introduce Using Statement" feature should correctly process the "Local declaration style" options. We will do our best to fix the problem as soon as possible. Once we resolve it, we will let you know in the context of this ticket.

                                1 Solution

                                Creation Date Importance Sort by

                                Fixed: