[Solved] Problems with OmniSharp and Visual Studio Code

SOLVED: Fixed the problem by reinstalling VS Code and the C# extension.

I’ve used Visual Studio Code for few days now to edit my scripts. VSCode was working, before VSCode updates. After the update, OmniSharp fails to validate the Unity project files and the editor refuses to initialize IntelliSense. Is this a bug or my own end? Reinstalled the C# extension but no luck.

I had to install Mono and it worked for me. Redirecting…

I also installed the other Unity related extensions but it was the Mono install that fixed that issue for me.

Hope this helps.

2 Likes

@EdKirby - Not working either. Maybe I need to install the 64-bit version of Mono for my 64-bit laptop?

Hey @tetriser0161 - Sorry for the very late reply. Hmmm…not sure. My Mac is 64 bit and all I did was download and install Mono from the link I posted above. If there is a 64 bit version perhaps trying that would help.

Oh, I should mention that since the time that I got VSC working I’ve completely jumped ship and moved to Windows. I’m running Parallels on my MacBook and went with VS Community 2015 and it works very well. I can do proper debugging now. The only issue I’ve found is when creating a new class, VS Comm 2015 doesn’t (always?) make the connection that it’s in the project so I don’t have all the Unity namespaces and such until I restart VS.

If you decide to go this route let me know. There are a couple of workflow gotchas you should be aware of.

Try Download Visual Studio Code Insiders for me it fixed these issues regarding VSCode and Unity 5.x integration on macOS:

No code errors or warnings being indicated.
No reference counting, peeking, etc.

Thx, @EdKirby and @mcpunkylt .

But I develop games on Windows, not macOS. Also, my internet connection just reaches its limit, so I can’t download Mono.

However, I got the latest update for Code after I reinstalling it.

I got just one question, how can I make Unity find VSCode again after I uninstall it, without reinstalling Unity?

@tetriser0161 I haven’t tried this but if you go Edit>Preferences then External tools you may be able to either find it in the drop down if Unity discovers it or browse to it manually.

1 Like

@EdKirby - Thanks, just browsed and located the Code.exe from Unity.

Good news, now OmniSharp runs and successfully validates the Unity project files as it should.

Code now got the Unity namespaces, but I dunno if this will persist… Thanks,

Kewl.

Just out of curiosity, since you are on Windows anyway, why don’t you use Virtual Studio 2015 Community Edition? It has almost all the same features as VS Pro, is free and (at least for me) it works better than Code.

@EdKirby - Well, I do use VS 2015 Community as well, but my laptop isn’t that “beefy” enough to make VS 2015 run faster. That’s why I prefer Code.

Ah ok. Makes sense.

Installing mono also worked for on Linux Ubuntu 16.04 Unity Editor!

I have issue in Mac + Unity 5.5 with IntelliSense, codelenses - installing insider version fixed my issue.

2 Likes

Thanks @EdKirby , installing Mono Framework worked immediately on macOS Mojave!

1 Like

Yeah this is what helped me out. I just hit the Reset Argument (3rd from the top)
and I also hit the Regenerate Project Files. I don’t get the notification any more.

I also had this issue on my Mac & it was fixed after setting omnisharp settings to always use mono from a specific path:

{
    "omnisharp.useGlobalMono": "always",
    "omnisharp.monoPath": "/Library/Frameworks/Mono.framework/Versions/Current/Commands/"
}

I am not sure if there is a “.sln” specific solution for this, but at least it works & I use dotnet on my mac mainly for Unity projects anyway.

2 Likes

This is the only thing that worked for me, thank you!

Hi, I am still getting the same error when two projects open. Any thoughts? Thanks!

1 Like