Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Help Wanted Visual Studio turn off auto using

Discussion in 'Data Oriented Technology Stack' started by iamarugin, Jun 4, 2020.

  1. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    534
    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?
     
  2. ZyderNarfall

    ZyderNarfall

    Joined:
    Jun 11, 2020
    Posts:
    8
    I’m having the same problem.
    I’m still looking into it.
     
  3. John_MSFT

    John_MSFT

    Joined:
    Feb 21, 2018
    Posts:
    64
    @iamarugin @ZyderNarfall

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

    upload_2020-7-17_13-43-56.png

    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.
     
  4. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    725
    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.
     
  5. John_MSFT

    John_MSFT

    Joined:
    Feb 21, 2018
    Posts:
    64
    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.
     
    Opeth001 likes this.
  6. ZyderNarfall

    ZyderNarfall

    Joined:
    Jun 11, 2020
    Posts:
    8
    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.
    https://forum.unity.com/threads/using-system-diagnostics-c-code-auto-fill.930621/#post-6089229
    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.
     
unityunity