Search Unity

Visual Studio 2019: Errors loading projects/scripts. Am I missing something?

Discussion in 'Code Editors & IDEs' started by DCTShinobi, Jul 1, 2020.

  1. DCTShinobi

    DCTShinobi

    Joined:
    Jun 23, 2014
    Posts:
    51
    Hello! I'm coming back to Unity after several years, and have run into a problem.

    I have several versions of Unity installed, and I was running with Visual Studio 2017, but it was wanting to download/convert frameworks/scripts every time I tried to open it, so I decided just ditch VS17 and also use the new version of Unity.

    So after searching for a solution, I updated Unity Hub and used it to install both Unity 2019.4.1f1 and Visual Studio 2019 (Community) at the same time. I made sure to point to VS19 in Unity's Preferences and selected Editor Attaching.

    When I double-clicked a script, it opened up VS19. The script displayed, but there was no Inellisense. And VS19 wanted me to download ".Net desktop development," so I did. After that, every time I open script from Unity, VS19 loads the script (the text is all there), but then pops a message window up saying ("NewTests3" is the Unity project for the following):

    "Microsoft Visual Studio
    One or more projects in the solution were not loaded correctly.
    Please see the Output Window for details."

    In the Output Window, I get this message:

    "E:\UNITY\PROJECTS\2019\NewTests3\Assembly-CSharp.csproj : error : Value cannot be null.
    Parameter name: value"

    In the Solution Explorer, it says the following:

    "Solution 'NewTests3' (0of 1 project)
    Assembly-CSharp (unloaded)"

    When I right click Assembly-CSharp and try to reload it, another window pops up saying:

    "Microsoft Visual Studio
    Value cannot be null.
    Parameter name:value"

    I've tried all different types of reinstalling and modifying. I've tried Unity 2018.19.4f1. Same thing. I've tried several different types of options in Unity's Preferences. I've tried several different things in VS19's options (including Tools for Unity options).

    I've also tried installing multiple frameworks and such. This is what I have installed according to VS19's Tools (under Tools, Get Tools and Features):

    Visual Studio core editor

    .NET desktop development

    Desktop development with C++

    Game development with Unity

    Individual components
    NuGet package manager
    .NET Framework 4.6.1 targeting pack
    C# and Visual Basic Roslyn compilers
    C# and Visual Basic
    F# language support
    .NET Core 2.1 LTS Runtime
    .NET Framework 4.6.2 targeting pack
    .NET Framework 4.7 targeting pack
    .NET Framework 4.8 targeting pack
    NuGet targets and build tasks
    .NET Framework 4.6.1 SDK
    .NET Framework 4.6.2 SDK
    .NET Framework 4.7 SDK
    .NET Framework 4.7.1 SDK
    .NET Framework 4.7.2 SDK

    So I don't know what I'm lacking. I followed this tutorial and got Visual Studio Code to work, so it seems that it must be something simple with VS19. And I'd much rather use the full VS19 than VS Code.

    I also tried following this tutorial to fix the problem, but it's years old, and the Tools for Unity that I have does not list the needed option.

    Any help would definitely be appreciated!
    Thank you very much, and may God bless you! :)
     
  2. John_MSFT

    John_MSFT

    Microsoft Employee

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

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi @DCTShinobi, could you try to upgrade to VS 16.6.3 ?
     
  4. Murray_Zutari

    Murray_Zutari

    Joined:
    Jun 1, 2017
    Posts:
    45
    I am having this same issue with VS Community (16.8.4). If I open a unity project solution (Assets > Open C# Project) then it loads everything in just fine. If I try open a single C# script from the project (with VS closed) then it fails to fully load the solution. It's basically just note pad in this state.
     
    CristianPalmas likes this.
  5. VSRRSR1

    VSRRSR1

    Joined:
    Apr 25, 2021
    Posts:
    1
    Unable to add scripts in Hierarchy due to error showing script does not inherit a native class that can manage the script In Unity
     
  6. sc0007

    sc0007

    Joined:
    May 3, 2022
    Posts:
    1
    i am facing issue with installing unity somewhat like microsoft visual studio community 2019 it is showing that completed with errors
     
    Last edited: May 3, 2022