Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Visual Studio Code - no intellisense, can't find mono

Discussion in 'Scripting' started by st33d, Dec 1, 2016.

  1. st33d

    st33d

    Joined:
    Jan 22, 2014
    Posts:
    27
    I've tried for many hours to get Visual Studio Code to work with Unity 5.5. I've been told that this extension for C# does not work:

    https://marketplace.visualstudio.com/items?itemName=ms-vscode.omnisharp

    I have uninstalled it. I have tried installing this extension:

    https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp

    It produces this error:

    Code (csharp):
    1.  
    2. Starting OmniSharp server at 12/1/2016, 2:34:34 PM
    3.     Target: /Users/cuboy/Documents/work/arrow/03/game/game.sln
    4.  
    5. OmniSharp server started wth Mono
    6.     Path: /Users/cuboy/.vscode/extensions/ms-vscode.csharp-1.5.3/bin/run
    7.     PID: 2845
    8.  
    9. OmniSharp: -s /Users/cuboy/Documents/work/arrow/03/game/game.sln --hostPID 2828 --stdio DotNet:enablePackageRestore=false --encoding utf-8
    10. {"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Startup","Message":"Omnisharp server running using Stdio at location '/Users/cuboy/Documents/work/arrow/03/game' on host 2828."},"Seq":1,"Type":"event"}
    11. [INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Initializing in /Users/cuboy/Documents/work/arrow/03/game
    12. [INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Auto package restore: False
    13. [INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Update workspace context
    14. [INFORMATION:OmniSharp.DotNet.DotNetProjectSystem] Resolving projects references
    15. [INFORMATION:OmniSharp#MSBuild] Detecting projects in '/Users/cuboy/Documents/work/arrow/03/game/game.sln'.
    16. [INFORMATION:OmniSharp#MSBuild] Loading project from '/Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp.csproj'.
    17. [WARNING:OmniSharp#ProjectFileInfo] Couldn't locate Mono, TargetFrameworkRootPath not specified
    18. [INFORMATION:OmniSharp#ProjectFileInfo] Using tools version: 15.0
    19. [ERROR:OmniSharp#ProjectFileInfo] The reference assemblies for framework ".NETFramework,Version=v2.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
    20. [WARNING:OmniSharp#MSBuild] Failed to process project file '/Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp.csproj'.
    21. /Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp.csproj
    22.  
    23. [INFORMATION:OmniSharp#MSBuild] Loading project from '/Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp-Editor-firstpass.csproj'.
    24. [WARNING:OmniSharp#ProjectFileInfo] Couldn't locate Mono, TargetFrameworkRootPath not specified
    25. [INFORMATION:OmniSharp#ProjectFileInfo] Using tools version: 15.0
    26. [ERROR:OmniSharp#ProjectFileInfo] The reference assemblies for framework ".NETFramework,Version=v2.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
    27. [WARNING:OmniSharp#MSBuild] Failed to process project file '/Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp-Editor-firstpass.csproj'.
    28. /Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp-Editor-firstpass.csproj
    29.  
    30. [INFORMATION:OmniSharp#MSBuild] Loading project from '/Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp-Editor.csproj'.
    31. [WARNING:OmniSharp#ProjectFileInfo] Couldn't locate Mono, TargetFrameworkRootPath not specified
    32. [INFORMATION:OmniSharp#ProjectFileInfo] Using tools version: 15.0
    33. [ERROR:OmniSharp#ProjectFileInfo] The reference assemblies for framework ".NETFramework,Version=v2.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
    34. [WARNING:OmniSharp#MSBuild] Failed to process project file '/Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp-Editor.csproj'.
    35. /Users/cuboy/Documents/work/arrow/03/game/Assembly-CSharp-Editor.csproj
    36.  
    37. [INFORMATION:OmniSharp.Startup] Configuration finished.
    38.  
    39.  
    I have already followed all of these instructions:

    https://code.visualstudio.com/Docs/runtimes/unity

    Still nothing works. I have tried to use Brew to reinstall Mono according to Microsoft's instructions. Still nothing works.

    I've spent hours and hours trying as many different combinations. I have tried with the Visual Studio plugin, and without. I have tried before 5.5 and after. Nothing works.

    If you have any suggestions as to what I'm supposed to do to get Visual Studio Code to work, I'm all ears, I'm quite stumped as to what I'm supposed to do.
     
  2. Glurth

    Glurth

    Joined:
    Dec 29, 2014
    Posts:
    98
    I've never heard of "Visual Studio Code". Is that some variant of visual studio 2015?
    I'm certainly no expert in this area, but remember I USED to need some kind of unity asset to use visual studio, but it no longer seems necessary. I just have it set in edit->preferences->externalTools as the "external script editor"
     
  3. Timelog

    Timelog

    Joined:
    Nov 22, 2014
    Posts:
    528
    Have you tried reinstalling Visual Studio Code? There might be some configuration conflict somewhere causing the software to not find mono.

    @Glurth Visual Studio Code is a multi platform lightweight code editor from Microsoft.
     
  4. rslnautic

    rslnautic

    Joined:
    Nov 16, 2015
    Posts:
    5
    I've got the same problem. Have you solved it?
     
  5. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675