问题
I was wondering if there is some option to keep ReSharper from removing just the using System;
directive? Perhaps this is configurable somewhere?
Also, is there a way to have ReSharper sort the remaining directives just as Visual Studio 2008 does it (alphabetically, I think)?
Thanks.
回答1:
Yes, there is such an option: ReSharper->Languages->C#->Namespace Imports. You can add namespaces,that should not be removed, as well as namespaces, that should always be imported.
回答2:
Yes, in the options (Resharper
> Options
> Languages
> C#
), there is a Namespace Imports
section that allows you to specify namespaces that should never be removed. You would put System
into the prompt it gives.
来源:https://stackoverflow.com/questions/356010/have-resharper-keep-using-system-when-optimizing-usings