Visual Studio turn off auto using

I am using Visual Studio 2019 with Unity. When I am working with DOTS and start typing Debug.Log VS automatically adding

using System.Diagnostics;

on top of the file. After that I should manually remove this line and then type

using UnityEngine;

to use Debug.Log from UnityEngine.

This is very annoying. How to turn off this behaviour?

I’m having the same problem.
I’m still looking into it.

@iamarugin @ZyderNarfall

Hey, Program Manager of Visual Studio Tools for Unity here. It seems this setting might be getting in the way:

Try disabling (Visual Studio > Tools > Options > C# > IntelliSense > Show items from unimported namespaces) that and see if it’s less annoying. In the meantime, I’ll add an item to our backlog to see if we can be smarter about this.

1 Like

i fixed it by removing Unity, Unity Hub & Visual Studio completely from pc then i reinstalled them.
20 minutes of pure pain but it works.

Yikes! I suggest anyone who runs into a similar problem try my solution first. I don’t know what re-installing would do / reconfigure to default here, but it’s certainly way more pain than necessary.

1 Like

Ok, so what fixed it for me was Edit > Preferences > External Tools > External Script Editor (Select the version of Visual Studio you are using) or browse for the Software you want to use.

The person on my thread answered it as well.

I do not claim to own or nor do I have anything to do with the video. It just helped me.
This is the video if you need it as well.
This is what fixed it for me.

Not sure if this will work for everyone or if it is appropriate but this was the closest forum I could find. I found the solution to this for my problem at Here. It was to do with an extension in Visual studio code called Auto-Using for c#. After I disabled this extension and reloaded the visual studio code editor it fixed my problem.