I found a possible solution
Goto Edit->Perference->Extenal Tools
Set your Extenal Script Editor as Visual Studio.
it’s sloved my porblem.
Unity 2019.2.4f1 on macOS 10.14.6 – Solution FOUND
I had the same issue opening C# files in Visual Studio on a brand new mac (though the Unity project was copied from 2019.2.2 on another mac).
Error:
Exception thrown while invoking [OnOpenAssetAttribute] method ‘Unity.CodeEditor.CodeEditor:OnOpenAsset (int,int,int)’ : InvalidOperationException: Cannot start process because a file name has not been provided.
System.Diagnostics.Process.Start () (at <9f8c4786222746238eb929db40bf8dd1>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.DefaultExternalCodeEditor.OpenProject (System.String path, System.Int32 line, System.Int32 column) (at /Users/builduser/buildslave/unity/build/Editor/Mono/CodeEditor/DefaultExternalCodeEditor.cs:123)
Unity.CodeEditor.CodeEditor.OnOpenAsset (System.Int32 instanceID, System.Int32 line, System.Int32 column) (at /Users/builduser/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditor.cs:52)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Solution:
- Open Unity > Preferences and go to External Tools as suggested by @unity_h9j2UpUioJSwXg .
- Below the selection of Visual Studio (which was already there), I found a text field with the “$file” in it next to a button labeled Reset Arguments.
- Clicking the Reset Arguments button caused both it and the text field to disappear AND seems to have fixed my problem.
I cannot say 100% this is the solution for you, but I had the exact same errors and I will tell you how I fixed them.
Go to: Window at the top → Package Manager → Advanced → Reset Packages to defaults
I have the same problem but none of the fixes here worked in Unity 2019.4.18.f1
To users facing the same problem,
I had the same problem while building for android. I am using Unity version 2019.3.9f1
Solution: In the build settings, “Add Open Scenes” and then try to build it)