PSA: If your VS Code C# extension stopped working...

If you opened VS Code today and your Unity Debugger wasn’t working or it was having issues detecting Assemblies, check if your C# extension updated to 1.21.13. They renamed the package, which was a breaking change.

You can find old package versions here: Releases · dotnet/vscode-csharp · GitHub

Download an older file, then in your extensions panel click the three dots in the upper right corner and select “install from VSIX…”. Install whichever older version you downloaded (1.21.12 and older should work.)
While you’re at it you might want to disable auto update extensions in your VS Code settings.

While you’re at it you might want to disable auto update extensions in your VS Code settings.

2020-04-02 Edit
I am now able to work successfully using the latest versions of all software. I am using:
VS Code - 1.43.2
C# extension (omnisharp) - 1.21.16
Debugger for Unity extension - 2.7.5.
VS Code Unity Package - 1.2.0.

2020-10-19 Edit
The latest Omnisarp (1.23.4) is broken today. My current working settings are:
VS Code 1.50.1
C# extension (omnisharp) - 1.23.2
Debugger for Unity - 2.7.5
VS Code Unity Package - 1.2.2

54 Likes

thanks so much! i just had the same experience, glad to know it wasn’t just me

thanks was annoying me

Just wasted half a day uninstalling and reinstalling my whole workflow. You saved me the other half of my day. Thank you.

Helped me too! Thank you for this. On a tight deadline and ofcourse this kind of problems with VsCode starts appearing… Finally took me only 30mins to fix it with those advices!! (would have been less but wanted to download something after the reset)

Thank you hero.

Thanks for this! I’m still having an issue however; installing v1.21.12 has got my C# extension working again, but now vscode is failing to find a whole lot of assemblies. Omnisharp log is full of entries like:

Unable to resolve assembly ‘c:\Users\USERNAME\Unity Projects\PROJECT\Temp\bin\Debug\UnityEngine.TestRunner.dll’

It is able to resolve some assemblies however, including Unity.Mathematics and a couple others.

Any ideas?

If you are on version 1.1.4 of the VS Code package, downgrade to 1.1.3, close Unity and VS Code and then reopen. There is a separate known issue in that package that is causing errors.

1 Like

Thanks so much! I have found threads for the other issue now that I know what to look for. I forgot I updated packages too.

thanksssss so much for the info, saved my life.

What do you mean VSCode package? The person you quoted said they installed version 1.21.12 of the extension, is that what you’re referring to? What version 1.1.4 are you referring to?

The VS Code Integration in the Unity Package manager.

2 Likes

Basic day in my Unity development “why isn’t this tool working? Yesterday it was fine.”

Also, thanks, saved the day.

4 Likes

Oh boy thanks! This was hella annoying!

Thanks for the tip @Incode !

Can someone at unity accept this pull request? Update C# extension's publisher name. by JoeRobich · Pull Request #152 · Unity-Technologies/vscode-unity-debug · GitHub It would be great to point at the renamed dependency.

1 Like

감사합니다.
이것이 정답입니다.

Thank you.
This is the correct answer.

Is there a real Unity + VS Code solution planned for this?

1 Like

vscode-unity-debug was updated today to point at the new C# dependency so you should be able to get the latest package.

I’m not sure what you mean? Are you asking for an “officially supported” extension?

1 Like

I just tried updating to the latest debugger, and C#/Omnisharp 1.21.14 and autocomplete and suggestions were still broken. Not sure if others are having this issue, but I’m reverting to my workaround for the time being.

1 Like