Ticket T424833
Visible to All Users

Code cleanup does not remove all unnecessary usings

created 8 years ago

Hello,

I have the code below :

C#
using System.Collections.Generic; using System.Configuration; using System.Linq; namespace TransactionGenerator { public static class GeneratorConfiguration { public static int NumberOfThread { get { return int.Parse(ConfigurationManager.AppSettings["NumberOfThread"]); } } } }

After cleaning I have this :

C#
using System.Configuration; using System.Linq; namespace TransactionGenerator { public static class GeneratorConfiguration { public static int NumberOfThread => int.Parse(ConfigurationManager.AppSettings["NumberOfThread"]); } }

The System.Linq is not deleted by the "Code Clean up" but is deleted by "Remove unnecessary Usings" of VS2015.

This using should be removed.

Christian,

Answers approved by DevExpress Support

created 8 years ago

Hi Christian,
You can setup the behavior of this code cleanaup rule on the CodeRush options page
Follow these steps to get to the Namespace References options page:

  1. From the VisualStudio menu, select "CodeRush\Options…" .
  2. In the tree view on the left, navigate to this folder:

Editor\Code Style

  1. Select the "Namespace References" options page.
  2. Just remove the System.Linq from references list on this page.
    See the screencast - http://screencast.com/t/tgijMwkkQQwv.
    Show previous comments (1)
    DevExpress Support Team 8 years ago

      Hello Christian,
      I've created a separate ticket on your behalf (Optimize namespace references does not remove blank lines.). It has been placed in our processing queue and will be answered shortly.

      CI CI
      Christian Ista 8 years ago

        The option to remove the using System and System.Linq  does not exist anymore ?

        Thanks,

        DevExpress Support Team 8 years ago

          The list with ignored references on the "Options-Editor\All Languages\Namespace References" options page is now moved to the "Advanced" tab. Please see the attached screencast for details.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.