Search Unity

Can't load projects with Visual Studio 2019 16.6.0; error : Value cannot be null.

Discussion in 'Editor & General Support' started by Glitshy, May 26, 2020.

  1. Glitshy

    Glitshy

    Joined:
    May 26, 2018
    Posts:
    15
    I have been using VS2019 for some time without issues. After updating VS to the 16.6.0 version when opening the solution of my project I get the following error:

    C:\Unity Projects\MyProject\Assembly-CSharp.csproj : error : Value cannot be null.
    Parameter name: value

    I get this error for each project file of the solution. All projects are unloaded and manually reloading produces the same error.
    I can open the solution with VS2017 without issues. I tried repairing my VS2019 installation as well as re-installing or even using the 16.7 preview of VS. Anybody else encounter the same problem after updating Visual Studio?
     
  2. Jigglebizz

    Jigglebizz

    Joined:
    Mar 23, 2016
    Posts:
    2
    Yeah, seeing this too. Did you ever find a solution? I've tried the same stuff. What a ...useful... error message.

    I think the XML in the .csproj has gotten corrupted. I compared the .csproj against a new project's that works using Beyond Compare. The ItemGroup designations changed. In the working file all of the Reference tags are in their own ItemGroup, and all the compilation files (*.cs) are in their own ItemGroup. In the broken file, these are intermixed randomly. I fixed this, and I can open the property sheet now. However I'm still not able to attach to Unity. Working through that one now...
     
  3. Jigglebizz

    Jigglebizz

    Joined:
    Mar 23, 2016
    Posts:
    2
    Figured it out. This bit was missing from the project for some reason. Not sure if this GUID will always been relevant, but placing this in the XML within the <Project> got it to start debugging for me again:


    Code (XML):
    1.   <PropertyGroup>
    2.     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    3.     <UnityProjectGenerator>Package</UnityProjectGenerator>
    4.     <UnityProjectType>Game:1</UnityProjectType>
    5.     <UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
    6.     <UnityVersion>2020.1.4f1</UnityVersion>
    7.   </PropertyGroup>