Search code examples
unity-game-enginepackagevisual-studio-2019solution

Unity with Visual Studio 2019 : Assembly-CSharp (incompatible) in Solution Explorer


I'm new to Unity and can't find how to get it working with Visual Studio 2019 properly.

I just installed Unity 2020.3.13f1 (LTS) from the Unity Hub as recommended for Hololens developement.

I already had VS2019 latest version installed and working.

In VS2019, I installed: Tools => Get Tools and Features => Game development with Unity

When I double click a script in Unity, VS2019 open and I get the following error: Assembly-CSharp (incomptible)

enter image description here

Also in Unity, I have a warning: Visual Studio Editor Package version 2.0.11 is available, we strongly encourage you update from the Unity Package Manager for a better Visual Studio Integration

enter image description here

Update I fixed the warning (see below) but still have the error in Visual studio

  • In Unity, I updated the package: Window => Package Manager => Visual Studio Editor => 2.0.11
  • I also did: Edit => Preferences => External Tools => Regenerate project files

enter image description here

I now have all latest Unity package versions:

enter image description here

But I still have: "Assembly-CSharp (incomptible)", How to get valid solution in Visual Studio ???


Solution

  • Have had this issue for months... After numerous different posts/guides on this issue, I found just right clicking and hitting "Reload project with dependencies" for each project worked.

    Now this was after fully updating Visual Studio and Unity, uninstalling the VS Unity tools, reinstalling, and reconfiguring visual studio tools in Unity... Figured I'd add this to to the list of things to try because it worked for me!