Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Intellisense not working in Visual Studio 2017

Discussion in 'Scripting' started by MistaGoustan, Oct 27, 2017.

  1. MistaGoustan

    MistaGoustan

    Joined:
    Mar 1, 2015
    Posts:
    4
    I have found that there are several problems with losing intellisense in my scripts while using Visual Studio 2017 (not sure if this persists in MonoDevelop). It still will compile the code it will just, for example, lose all color behind UnityEngine references and any other project file references, and lose the ability to autocomplete. Such as interfaces and other things.

    One know way to reproduce this bug:
    - Open script Visual Studio
    - In Unity move script to a different folder
    - Return to Visual Studio
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Once you move the script, you would want to reopen the file in Visual Studio. Does this work?
     
  3. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    I've actually encountered the same issue as of late. The only remedy I've found is to delete the hidden .vs folder in the root project directory -- I'm assuming the .suo file specifically -- and then reopen visual studio for it to be rebuilt.

    This happens for me on any new script created, or moved to a new folder. Closing and reopening VS doesn't resolve the issue for me.

    I'm using VS 15.4.1, and Unity 2017.1.1f1
     
    Last edited: Nov 6, 2017
    MistaGoustan likes this.
  4. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    Heh, and here I was thinking it was just me. Observed the same thing -- Unity and VS2017 seemed to behave badly. I thought it was just because I still had VS2015 installed for previous versions of Unity (I keep them installed), so that probably confused things on my system (specifically the Unity for VS tool).

    I just stuck with VS2015 for Unity projects, and VS2017 for non-Unity projects.

    Of course there's still the problem of Unity crashing when I tried to hit a breakpoint in a coroutine, but that's another conversation.
     
  5. MistaGoustan

    MistaGoustan

    Joined:
    Mar 1, 2015
    Posts:
    4
    No. This seems to be a common error. New enough for no one to post about it. Seems like its because a more prevalent problem in Unity 2017.
     
  6. MistaGoustan

    MistaGoustan

    Joined:
    Mar 1, 2015
    Posts:
    4
    Sweet! I'm glad there is a workaround. Thank you.
     
  7. mark-007

    mark-007

    Joined:
    Mar 4, 2015
    Posts:
    23
    Thank you for the workaround - this has been driving me nuts :)
     
    MistaGoustan and LiterallyJeff like this.
  8. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,140
    I see this problem too - Add a new class in Unity - double click to open in visual studio 2017 - it knows nothing about Unity types for that new class. Also if you click the "Sync with active document" button in the Solution Explorer it does not work for the new file (though in UnityProject Explorer it does).

    2017 seems to be a step backwards for Unity compatibility (unless it's my Unity editor version - 5.5.5)

    perhaps better to stick with 2015 for now (does 2017 add any must-have additions?)
     
  9. OldRod

    OldRod

    Joined:
    Mar 2, 2009
    Posts:
    136
    Sometimes you can go into the Solution Explorer in VS and click "show all files", then find the file you are working on, right click it and "add to project", and that fixes it.

    But sometimes (about 25% of the time), this option isn't available when this problem crops up for me.
     
  10. DavidSmit

    DavidSmit

    Joined:
    Apr 1, 2014
    Posts:
    50
    Same happens for me. Running 2017.1.2p1
    It didnt happen on my previous setup. But after getting a new PC, this happens every time I create a new c# file.

    When this happens, and I rebuild the solution, it suddenly also loses references to other classes of certain plugins (like EasySave2)
     
  11. abertrand

    abertrand

    Joined:
    Dec 7, 2015
    Posts:
    29
    Here is a MSFT fix: https://developercommunity.visualst...lisense-not-working-after-creating-new-1.html
     
    LiterallyJeff likes this.
  12. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
  13. RobG88

    RobG88

    Joined:
    May 28, 2015
    Posts:
    27
    All, this was DRIVING ME MAD for about 4 hours. Tried so many things, un-installing Unity & VS, re-installing. [Unity 2017 2 & 1 and VS 2017]

    Ultimately here is the fix for me, hopefully this helps others:

    Do the following:

    - Close both VS and Unity

    - Launch VS 2017 Installer

    - Click Modify

    - Go to the "Individual components" tab

    - In the "Code Tools" section, check "Nuget Package Manager"

    - Click Modify

    Now, reload your project in VS/Unity.

    It should solve your build+intellisense issues.