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
  4. Dismiss Notice

Question Mac VSC & Unity "Some projects have trouble loading. Please review the output for more details"

Discussion in 'Code Editors & IDEs' started by Jonah60, Nov 6, 2020.

  1. Jonah60

    Jonah60

    Joined:
    Oct 27, 2020
    Posts:
    6
    I was recently trying to get into game development with Unity. I chose Visual Studio Code for my script editor. After trying to figure out why they would not work, I found that the C# build for VSC was having trouble installing. The console said to download the .NET Framework Version 4.7.1, which I tried, but the file type was only compatible for windows. Please Help!

    Error: (File Location & Stuff) The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks.

    I also Tried Installing MonoDevelopment because it was recommended for Mac users.

    Mono Link: https://www.mono-project.com/download/stable/

    Referenced Instructional Website: https://code.visualstudio.com/docs/other/unity

    Any other info needed will be provided.

    Thanks!
     
  2. John_MSFT

    John_MSFT

    Microsoft Employee

    Joined:
    Feb 21, 2018
    Posts:
    118
  3. Jonah60

    Jonah60

    Joined:
    Oct 27, 2020
    Posts:
    6
    Thanks @John_MSFT, I decided to just switch to Visual Studio, and am having no problems. Thanks
     
    John_MSFT likes this.
  4. PlanetaryElephant

    PlanetaryElephant

    Joined:
    Mar 29, 2021
    Posts:
    3
    Hello,

    I'll leave this here as I struggled through this and finally got Intellisense working for UNITY (v. 2021.1.2f1) in VS Code.

    This is how I got it working:

    Install VSCode, .NET, and Mono
    1. Download Install Visual Studio Code from: https://code.visualstudio.com - don't open VS Code yet.
    2. Download and install the .NET framework from: https://code.visualstudio.com
    3. Download and install Mono from: https://www.mono-project.com

    Install and configure the C# Extension for VSCode

    1. Open Visual Studio Code and, in the menus, choose View > Extensions
    2. In the Search Extensions box type "C#"
    3. In the results, click on C# (it has a green/white icon) and in the right panel you will see the details of the extension.
    4. In the details panel, click the Install button,
    5. Now check that it's installed:
      • In the Extensions panel on the left, click the funnel/filter icon and select Installed
      • You will now see that C# is listed in the installed
    6. All good? OK, then finally we need to make a configuration change to the C# extension:
      1. Find the settings.json file:
        • Windows: %APPDATA%\Code\User\settings.json
        • macOS: $HOME/Library/Application Support/Code/User/settings.json
        • Linux: $HOME/.config/Code/User/settings.json
      2. Before the last curly brace '}', add the following line:
        "omnisharp.useGlobalMono": "always"
      3. Save the file and restart VS Code.
    Now, when you edit a Unity script in VS Code, you will get full Intellisense functionality. Note that you have to be patient for a few seconds when VS Code loads while it starts Omniserver and loads the Mono Framework, but once it has, it works great.

    Cheers!
    PE
     
  5. muhammadfathurnur

    muhammadfathurnur

    Joined:
    Oct 17, 2021
    Posts:
    1
    Wow thank you soo much it's really works.
     
    jkoutavas likes this.
  6. itsEbi

    itsEbi

    Joined:
    Dec 5, 2021
    Posts:
    2
     
  7. itsEbi

    itsEbi

    Joined:
    Dec 5, 2021
    Posts:
    2
    How do I find settings.json file:?
    and where do I type $HOME/Library/Application Support/Code/User/settings.json?
     
  8. zunairm444

    zunairm444

    Joined:
    Jan 30, 2022
    Posts:
    1
    Hi I did this as you suggested and thank you for that as the original error has now now been fixed however interstellar still those not work infact when I open up a script in unity c# commands don't work such as Console.WriteLine image.png Screenshot 2022-01-30 at 00.37.25.png
     
  9. akmt9

    akmt9

    Joined:
    Apr 27, 2022
    Posts:
    2
    THANK YOU
     
  10. akmt9

    akmt9

    Joined:
    Apr 27, 2022
    Posts:
    2
    go the the finder then you will find (Go) up in the task bar click it and then choose (Go to Folder) and type (library) and thats it navigate to Application Support/Code/User/settings.json
     
  11. usoft06

    usoft06

    Joined:
    Oct 24, 2019
    Posts:
    1
    Thank you so much, I tried a lot of solution before, but this solution fixed my problem after 15 days of test :)
    thank you again
     
  12. ernyy

    ernyy

    Joined:
    Apr 24, 2020
    Posts:
    1
    I've been struggling with this issue for years now, getting it fixed until it got broken again some time later over and over again and I already had the "omnisharp.useGlobalMono": "always" line

    For anyone still struggling with this, here is something I found in the documentation of the C# extension:

    -> "If you still need Unity or .NET Framework support, you can set omnisharp.useModernNet to false in your VS Code settings and restart OmniSharp."

    That did it for me.

    EDIT:
    As I understand it, Mono seems to no longer be required with newer versions of Unity and OmniSharp no longer ships with Mono. If, like me, you are still using an older version of Unity, setting that variable to false will force the download of the appropriate Mono version.
    Im on Unity 2020.1.1f1 but depending on your version of Unity, Mono may not be the cause of the issue. Therefore, adding that line to your settings.json may not be the fix you're looking for considering this issue has been around for so long and there always seems to be a different fix.
     
    Last edited: Jun 12, 2022
  13. DHRUVMEHALAWAT

    DHRUVMEHALAWAT

    Joined:
    Jul 4, 2022
    Posts:
    1
    There’s no code folder in application support folder in my mac plz help
     
  14. Arnau478

    Arnau478

    Joined:
    Sep 18, 2020
    Posts:
    1
    Just open VSCode and run the command
    Preferences: Open User Settings (JSON)
    . That should open the settings.json file
     
  15. LOU109

    LOU109

    Joined:
    Jul 1, 2020
    Posts:
    1
    I just synced to GitHub and seemed to do the trick
     
  16. biminiroadelectronics

    biminiroadelectronics

    Joined:
    May 20, 2022
    Posts:
    1
    This worked, thank you!!!
     
  17. PinkTreeArts

    PinkTreeArts

    Joined:
    Dec 25, 2021
    Posts:
    11
    I'm having a similar problem.

    Every time I load VS Code, I get the message "Some projects have trouble loading, Please review the output for more details."

    I am using VS Code 1.76.2 on a Mac running OS 10.15.7

    TBH I am a total beginner; I'm literally just trying to write my first ever code in a Unity project and I feel like I have to learn all of these things that are way beyond my skill level just to print "hello world" for the first time.

    I vaguely recall struggling with this ages ago when I first downloaded unity and first set up VS Code. I have no idea WTF Mono is but I installed it. (I really hate installing software without having any idea what it is.) I'm pretty sure I installed .NET Framework at that time too-- yet again, I have no idea what it is, and anytime I try to look up what any of these things are I just feel like I am baragged with a whole bunch of other terms and concepts I don't understand.

    I just re? installed Mono, hoping that might fix it. Restarted my computer and restarted Unity and VS Code and got the same error message.

    I think I already have .NET framework, maybe? I tried following the link posted above but it just took me to the page to install VS Code.

    If I disable the C# extension in VS Code I don't get that error message.

    With C# disabled or enabled, Unity autocomplete doesn't work, and I can't get the script to use Unity things... I don't know the technical term. Like it won't recognize Time.deltaTime and will give me a compliing error if I try to use it.

    Anyway, if anyone can give me the beginner-friendly version of what I need to do, I would really appreciate it. Sometimes game development feels like this walled-in circle of terms that if you don't already know what they mean there is no way to find out.
     
  18. PinkTreeArts

    PinkTreeArts

    Joined:
    Dec 25, 2021
    Posts:
    11
    Okay updated comment:

    I already had Mono installed, but I reinstalled it anyway.
    I already had .NET 6 SDK installed, but I reinstalled it anyway.
    Restarted my computer both times just for good measure.
    Still getting that damn error message.
    Located the settings.json file. It already had "omnisharp.useGlobalMono": "always" typed into it.
    Still getting the stupid error message every time I load a Unity C# script in VS Code with the C# extension on.
    Still won't autocomplete Unity things (methods? I dunno wtf these things are called, sorry.) But it appears I can use Time.deltaTime in a script, VS Code just won't recognize it.
    Tried chaning it to "omnisharp.useGlobalMono": "false" Still got an error message.


    Btw, for anyone else on a Mac who had the same problem locating the "Code" folder, go to your USER folder and find the Library folder in there, not your main startup disc Library folder


    Here's the error message I keep getting. If anyone can help me figure out WTF this means, would really appreciate it

    [fail]: OmniSharp.MSBuild.ProjectLoader
    This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).
    [warn]: OmniSharp.MSBuild.ProjectManager
    Failed to load project file '/Users/saffo/Unity/Projects/Blank Project/Assembly-CSharp.csproj'.
    /Users/saffo/Unity/Projects/Blank Project/Assembly-CSharp.csproj
    /usr/local/share/dotnet/sdk/6.0.407/Microsoft.Common.CurrentVersion.targets(1220,5): Error: This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).​
     
  19. PinkTreeArts

    PinkTreeArts

    Joined:
    Dec 25, 2021
    Posts:
    11
    Okay, sorry everyone for all the melodramatics. (Although I do think that coding/ development can be a bit of a closed loop sometimes which is really frustrating.)

    I finally figured out how to turn off that setting and it seems to have fixed both problems (the error messages and the failure to auto-complete.)


    The instructions here are helpful: https://code.visualstudio.com/docs/other/unity


    For anyone like me who is new to this stuff and gets freaked out, let me try and summarize what I did. In the end it's not that different from what was suggested above, except I had to turn the "always" setting OFF for Use Modern Net.

    If you're on a Mac and having trouble with VS Code, getting that weird error message ^, or you are not getting unity auto-complete stuff showing up in your VS Code, try this:

    - Install Mono (I still have no idea what it is.)
    - Install .NET SDK (latest version)
    - Inside VS Code, type Command-Comma. There should be a little search bar insite the little settings tab that opens up. Type "omnisharp use modern net". Make sure to uncheck the little box that shows up. Save everything and quit both VS Code and Unity. Reopen them. When you reopen VS Code you might get a little message that it's installing something.
    - Hopefully, once it's installed, things will work.

    I still have no idea WTF I just did, or what Mono or .NET are, or what the difference is between .NET SDK and .NET Framework. But somehow this seemed to work.
     
  20. PinkTreeArts

    PinkTreeArts

    Joined:
    Dec 25, 2021
    Posts:
    11
    Screen Shot 2023-03-19 at 7.38.30 PM.png

    So I guess it actually says right there that Modern Net doesn't work with Unity?
     
  21. PinkTreeArts

    PinkTreeArts

    Joined:
    Dec 25, 2021
    Posts:
    11
    Okay, a few more things, the .NET install link above was wrong.

    If you're on a Mac, here's the link:

    https://learn.microsoft.com/en-us/dotnet/core/install/macos

    ALSO, here's what my settings.json file looked like in the end:

    {
    "workbench.colorTheme": "Default Dark+",
    "omnisharp.useGlobalMono": "always",
    "omnisharp.useModernNet": false
    }

    You should be able to change the settings within VS Code, but if not, you can find this settings file here: Screen Shot 2023-03-19 at 7.42.49 PM.png


    Anyway, hopefully if anyone else is as hopelessly lost and confused as I was, this will help.