What is it with Unity and VS Code?

I am slowly losing every hope of getting VS Code to work with Unity nicely. Is anyone else having similar issues?

For the past few builds VS Code would work one day, and the next day just randomly stop working. What I mean by “stop working” is the following behavior:

  • I cannot open my current Unity project manually anymore.
  • VS Code doesn’t start from inside Unity anymore.
  • Intellisense doesn’t work if I only open my asset folder inside VS Code.
  • Other / older Projects open just fine.

Whenever I think I know the solution to my problem, that stops working a day (or restart?) later too.
Here’s what I’ve tried and what seemed to be working (for a day at least)

  1. Move the project folder out of my Dropbox
  2. Delete the sln file, restart Unity and hit “Open C# project”

If anybody has any suggestions as to how I can get VS Code and Unity play together nicely, I’d be more than happy. I am at a complete loss.


2019.2.8f1, VS Code Package 1.1.2

In case anyone is interested in yet another variable to keep in mind while trying to figure stuff out:
If you try a new solution, make sure you kill all hidden VS Code instances running in the background. Apparently Unity does start VS Code in hidden mode, so just doulbe check.

Got it working (for now with this fix)

When I was using unity I was using sublime text.

Script inspector 3

Don’t use dropbox to move in out whole project. Use repository and versioning. You will save a lot on frustrations in future.

6 Likes

Thanks, I’ll definitely look into that :slight_smile:

I got tired of VS code and subbed to Rider for about £9 a month. Its easily worth 10x that in savings of both time and how much of a better programmer it has made me. I had no idea the sort of stuff it was going to do until I got it but my god does it make some amazing suggestions and do some really time saving tasks.

4 Likes