Search Unity

5.6.0p4 Visual Studio for Mac isn't working... says Application Support - Addins directory missing

Discussion in 'Editor & General Support' started by yakandco, May 9, 2017.

  1. yakandco

    yakandco

    Joined:
    Dec 3, 2014
    Posts:
    90
    As the title says Visual Studio for Mac isn't working for me on 5.6.0p4... when I try and point the external tools preference to the freshly installed app I get this the error message:

    DirectoryNotFoundException: Directory '/Users/Jason/Library/Application Support/VisualStudio/7.0/LocalInstall/Addins' not found.

    The whats new text for this patch version says:

    Improvements
    • MacOS: Support Visual Studio for Mac as an External Script Editor. Opens .sln (solution) file when double clicking a script.
    Is there something I'm meant to do to configure Visual Studio to work with Unity perhaps?! Thanks for any help!!

    Jason
     
  2. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    I know absolutely nothing about this, but just a thought - do you maybe have to run Visual Studio at least once for it to initialise and maybe create that missing directory? Only thinking this as you said the app was freshly installed (and maybe not run?).
     
  3. yakandco

    yakandco

    Joined:
    Dec 3, 2014
    Posts:
    90
    yea I thought that too.. thanks for the suggestion. Although I haven't opened a project, perhaps it needs that to run some extra first run setup?!
     
  4. KAKE

    KAKE

    Joined:
    Apr 5, 2005
    Posts:
    57
    I'm seeing the same problem. I've run VS and perused the extensions to see if there's something else I'm missing. Please post if you manage to get it working.
     
  5. KAKE

    KAKE

    Joined:
    Apr 5, 2005
    Posts:
    57
    Okay, it appears to now be working. What I ended up doing was closing and restarting Unity, and opening the solution file manually in VS. Now the preferences pane shows VS as the selected editor and I no longer see the error. Seems like maybe there's still a bug or two for Unity to work out, but it's now working as intended.
     
  6. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    I'm curious to hear anyone's thoughts on Visual Studio for Mac vs. Visual Studio Code. I'm pretty happily using Code now and wondering if there's any point in switching.
     
  7. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Playing with this now too. I can't get it to work regardless of what I do. I always still get that error message. Hopefully someone from Unity might chime in.

    Looking at my filesystem, this entire portion of the path doesn't exist: VisualStudio/7.0/LocalInstall/Addins




    DirectoryNotFoundException: Directory '/Users/stevejarman/Library/Application Support/VisualStudio/7.0/LocalInstall/Addins' not found.
    System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:514)
    System.IO.Directory.GetDirectories (System.String path, System.String searchPattern) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:275)
    System.IO.Directory.GetDirectories (System.String path, System.String searchPattern, SearchOption searchOption) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:282)
    UnityEditor.VisualStudioIntegration.UnityVSSupport.GetVSForMacBridgeAssembly (System.String externalEditor, System.Version vsfmVersion) (at /Users/builduser/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/UnityVSSupport.cs:123)
    UnityEditor.VisualStudioIntegration.UnityVSSupport.InitializeVSForMac (System.String externalEditor) (at /Users/builduser/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/UnityVSSupport.cs:46)
    UnityEditor.VisualStudioIntegration.UnityVSSupport.Initialize (System.String editorPath) (at /Users/builduser/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/UnityVSSupport.cs:30)
    UnityEditor.VisualStudioIntegration.UnityVSSupport.ScriptEditorChanged (System.String editorPath) (at /Users/builduser/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/UnityVSSupport.cs:316)
    UnityEditor.PreferencesWindow.OnScriptEditorChanged () (at /Users/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesWindow.cs:431)
    UnityEditor.PreferencesWindow.AppsListClick (System.Object userData, System.String[] options, Int32 selected) (at /Users/builduser/buildslave/unity/build/Editor/Mono/PreferencesWindow/PreferencesWindow.cs:1094)
     
  8. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Alright, I just manually created the rest of the path and now everything works perfectly.
     
  9. jason_yak

    jason_yak

    Joined:
    Aug 25, 2016
    Posts:
    531
    I'm not sure the vs between those two.. but there are some reservations I have about Code. I like how snappy and fast it is which is really great, but the code completion and some other syntax recognition is lacking compared to MonoDevelop.

    • In MonoDevelop I get auto-suggestions for things like enum values when writing 'if ( someEnumVar == SomeEnum.[insert drop down of enum values here] )'.
    • Code lacks showing what method signature delegate methods have when entering arguments.
    • It does not seem to offer any way to automate adding package imports for missing definitions.
    • Code folding doesn't work or 'greyed' out syntax highlight for #region pre-compiler directives.
    • It does not make any smart assumptions out of the possible auto-complete options and always defaults to alphabetical rather than most used or most relevant which almost always ends up requiring me to type a few extra characters to get to the option I want.

    These are main gripes so far.. I've been using it for a week or so, but I think I'm going to give up because it's taking me much longer to write code as a result. These are the reasons I want to try out Visual Studio for Mac because it's based on Xamarin's IDE (I believe) and is going to be much closer to how MonoDevelop works (but hopefully much less buggier).

    My absolute biggest gripe for MonoDevelop though and the ONLY reason I need to find something else is because it is sooooo buggy with getting tab indentation correct. Even though code folding or showing code greyed out when inside pre-compiler directives works, this seems to be the thing that throws out tabbing indentation levels. For example I hit enter and instead of it dropping to the next line at the correct tab indentation, it will drop to maybe two tabs to the left.. infuriating!!
     
  10. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    I hear ya. I have some of the same issues with MonoDevelop. They're minor gripes but become a major headache when you're spending many, many, MANY hours putting up with them.

    I was pretty happy with Code. The main thing I missed - and it will sound so minor - is the function/method explorer dropdown. VS for Mac has that, so that makes me happy.

    Now that VS for Mac is working, I'll use it for the next few days and see how things go. So far it's very fast and looking promising.
     
  11. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    One unfortunate side-effect of Visual Studio for Mac is that it seems to change the solution files in a way that prevents them from opening in Visual Studio on Windows. Bit of a deal breaker for me as I still open my projects periodically on Windows in order to run Codemaid on them :(
     
  12. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Might have some answers.......

    It turns out that when you search for "Visual Studio for Mac", it's still very likely that you'll end up on the page for the "Preview" version, and you'll still be allowed to download it.

    If that's the case, you might not realise the Visual Studio for Mac 2017 Community Edition is actually officially available now.

    I'm now upgrading both my Mac version and Windows version to the correct one, and will then see if the solution file is compatible between the two. Fingers crossed.
     
  13. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Oh well... turns out that even if you have the 2017 version on both Mac and Windows, once you've opened a solution in the Mac version of VS, it will no longer open in the Windows version of VS (says that the solution is incompatible). Bit of a problem for me so I'll have to switch back to Code for the time being.
     
  14. DavidErosa

    DavidErosa

    Joined:
    Aug 30, 2012
    Posts:
    41
    I can confirm that, for me, after manually creating the "Addins" directory, the error went away and Unity displays "Visual Studio" as an option on the external tools preference tab. Thanks!