Visual Studio C # auto-generated method adds "using System"; How do I disable it?

I am using VS Community 2017 Version 15.2

When I use the lightbulb suggestions or manually press (Ctrl +.), It generates a method like this:

using System;
public void f() {
    throw new NotImplementedException();
}

      

I want it to be like this:

public void f() {
    throw new System.NotImplementedException();
}

      

Without:

using System;

      

I looked through the settings as well as online but couldn't find this option.

I want this because I like to maintain a clean namespace. I don't want to manually delete the using statement every time I use this handy function.

+3


source to share


1 answer


Visual Studio does not provide this behavior by itself, as this is not normal behavior. However, if you are using Resharper , you can install it manually.

Resharper β†’ Option

enter image description here



(in options window) Code Editing -> C # -> Code Style

enter image description here

Find link qualifications and check preferred full links

-1


source







All Articles