So randomly today visual studio code stopped working.
Whenever I try to open a script through the editor, nothing happens and visual studio code just hangs in the background processes doing nothing. No actual window will appear.
If I try to open file by extension (and not have the editor set to visual studio code), visual studio code actually opens but it’s obviously not attached to unity so it’s impossible to code in as it doesn’t know the project and no auto completion. BUT It also makes this error in the console “Win32exception the system cannot find the file specified.” so something is broken (but it opens it anyway, but wont attach to unity)
I’ve tried reinstalling all of unity and unity hub, removing everything and installing it again. I’ve tried taking some of my backups and opening them, but it keeps happening.
I recently updated to 2019.2.8, but it worked fine for 2 days prior and I didn’t have this issue. It only started happening today. Other than not opening the code editor everything else works fine.
Please help I can’t work on the project at all cause of this bug.
Hello, I’m using Visual studio version 1.39.0. Are you sure u mean 1.1.10 ? or am i looking at the wrong version number.
whenever i had the bug i tried updating it and it still didn’t work.
I reinstalled everything and everything is up to date.
My problem isn’t that scenes wont open in Unity. It’s that trying to open scripts wont open visual studio. it says the file doesnt exist and i cant attach it to unity
I was talking about the Unity “Visual Studio Code Editor” package, which can be found in the Package Manager window. Also, make sure that you have selected “Visual Studio Code” as your external code editor.
I’ve had so many problems with vscode I’ve given up and gone back to vs community.
Just tried a new project with 2019.2.9 + package version 1.1.2, Assets > Open C# Project won’t open or double clicking scripts. Other people have described it here: https://discussions.unity.com/t/745313
Sorry for necroing this thread but I’m experiencing this exact issue. Using Unity version 2019.2.0f1 with VSCode package version 1.0.7. I was able to use Unity with said package until it stopped loading VS code when I tried to open a script. I’ve tried upgrading the package to version 1.1.2 and 1.1.3 but neither were able to resolve the issue. Has anyone managed to get VS code working from this problem?
just pushing this as i am experiencing the exact same.
thank you for looking into this again
Edit: ok i solved it on my end by manually deleting all vs code extensions in User/.vscode/extensions and opening up a file with vsc i have in my unity project.
vscode immediately recommended to install c# extension by microsoft wich i did. then i closed vs code and tried opening a script through the unity ditor and voila! it works again.
make sure both programs, extensions and unity vscode package is up to date.
hope this will help anyone experiencing the same issue!
have a nice day!
I had same problem with Unity 2020.2.0b10, after doubleclick on script Visual Studio wont open.
After hours of trying multiple things I deleted both “Visual Studio Code Editor” and “Visual Studio Editor” from “Window/Package Manager”. It saved the issue. However I’m not sure if it was the right solution of the problem.
If VS doesn’t start or doesn’t open the project after launch- try start unity from admin.
(also, If breakpoints cannot be set- “Regenerate project files” button)
One day I made compatibility for VS to always be launched from admin (some things doesn’t work without admin) and forgot about that. Seems non-admin processes cannot launch the admin process.
I have deleted and re-installed unity editor and Vstudio, like three times now. But all script lines associated with Unity wont be recognised by visual studios. Whats happening?
I tried almost everything in this thread, I was able to open files in vs code but without intellsiense when both VS Editor and VS code editor unity packages were uninstalled.
What fixed it with intellisense (ie what I wanted) is having the VScode package installed, and then in prefences>external tools, instead of selecting vscode from the list, I browsed for the executable.
Similar issue to few of the above, but my script opens up in visual studio 2019 right now. The code i have in visual is just a simple edit name of game object. It even did the autocorrect parts. Once i save and go back to unity to press play, the game ‘runs’ but the name never changes. No errors on the visual side. any suggestions? I did the same process through Visual studio code and got the same results.
This may help you with intellisense and possibly other Visual Studio integration problems:
Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.
Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.
Barring all that, move on to other ideas:
Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button
hey all, I had a similar issue (different vs code and unity versions) but the cause of my issue is because I moved VS Code to a different folder after I set Unity External Tool selection as “visual studio code.” So Unity remembered the old application file path, and the app no longer exist under the old file path. The fix is to just set the External Tool editor selection again. Hope this helps!
The suggestion such as deleting “visual studio code” package worked for me as well, but I think that wasn’t the root of the issue and I’d prefer to have the packages.