Can't attach Visual Studio debugger to Unity 2020
The option "Attach to Unity" does not appear on Visual Studio for Mac:
Also, on Unity's Preferences -> External Tools, I don't see a "Editor Attaching" option:
Everything was working fine a couple of days ago, and I didn't update Unity, Visual Studio, or macOS.
Any ideas?
Environment:
macOS Catalina 10.15.7
Unity 2020.1.4f1 Personal
Visual Studio for Mac Community v8.7.8 (build 4)
Answer by MarcVit · Oct 07, 2020 at 10:53 PM
For anyone going through the same problem, I just had to go to Unity -> Preferences -> External Tools -> and click on "Regenerate project files".
This thread helped me: https://forum.unity.com/threads/cant-see-attach-to-unity-button-in-visual-studio.463530/#post-5890835
Answer by nikix22 · Feb 22 at 03:19 PM
I founded one solution which might work for all cases. 1. Just start any version of VS separately from Unity. 2. Open solution file which is previously generated for project. 3. Open Unity, and double click on any script. It will be opened in VS and Attach will be there.
Note: I have project in Unity 5 and was working with VS 2017. Sln file is generated by VS 2017. And now on this way I can use VS 2019 and VS 2022 normaly.
Your answer
Follow this Question
Related Questions
I cant attach Visual Studio debugger to Unity 0 Answers
Visual Studio Mac and Problem with Debugging 0 Answers
Visual Studio (Mac) not searching for documentation in Hub paths 1 Answer
Once and For All: Mac Visual Studio - fix inconsistent line endings? 3 Answers
Can't code on Mac: "The reference assemblies for .NETFramework,Version=v4.7.1 were not found " 1 Answer