Intelisense problem

Did you install the Developer Pack? The “normal” version does not work. That’s why I explicitely mentioned and linked the required one.

Yes, Visual Studio and Visual Studio Code are two different programs. So are the Visual Studio Editor and the VIsual Studio Code Editor package.

1 Like

Hi Nina,

Yes, I installed the .NET Framework 4.7.1 Developer pack.

I’m thinking of trying a complete uninstall / reinstall of VS Code to see if that helps - and if not, trying Visual Studio (community Edition) as you suggested. Unless there’s anything else you think I could try first?

Thanks

1 Like

After you uninstalled VS Code, restart your computer first. Then install VS Code again.

1 Like

Hi Nina,

Well - good news first: a reinstall seems to have fixed the error message problem

Bad News: I am now back to where I started with Intellisense not doing it’s job…

Just to be clear, I am getting predictive stuff appearing but it’s not the same as Rick’s - for instance, I don’t get all the different keys appearing after typing Keycode. (CTRL + Shift + SPACE does nothing)

See image:
My version on the left / Rick’s on the right

I also notice comparing the two images that I don’t get the stuff at the top: Assets > Movement > ProcessInput …?

So…what next? Try Visual Code Community? Carry on without Intellisense or is there something else we can try with Visual Studio Code?

I just noticed something else: i adjusted the Omnisharp project load timeout from 60 seconds to 600…because it seemed to be having problems with server load time out(??)

Closed everything down and restarted but the OmniSharp log is showing the message below

is this significant that Omnisharp is not registering?

Edit Note: I have just googled Omnisharp MSBuild and it does seem this is related to Intellisense not working

c# - Could not locate MSBuild instance to register with OmniSharp - Stack Overflow

‘As of May 2022, Omnisharp does not include MSBuild’ then someone comments
‘Hey, Unity User which face IntelliSense problem after May 2022! This is what you need…’

Visual Studio Build Tools?

There is also this:
Announcement: Planned removal of the included Mono & MSBuild tools · Issue #5120 · OmniSharp/omnisharp-vscode · GitHub

Seems to be related to the useModernNet setting?

Not sure about this…can anyone advise?

1 Like

Okay - update is I seem to have fixed the problem

Solution: In VSCode / C# settings / Extension settings / Omnisharp:use Modern net - click to select

This is contrary to advice given by GameDev, but seems to have done the trick - Intellisense is now working.

CTRL + Shift + Space also working now…

I will not close this post until someone can tell me why this works/and if this ‘solution’ is going to cause problems because the Omnisharp:Use Modern Net says it does not support Unity?

1 Like

Hi, i seem to be having the same problem even though i did what you said with use modern net.

1 Like

Hi AxeOnee,

I am just a beginner student who googled some stuff and maybe stumbled on a solution…for me. I think it may depend on what version of Unity & VS Code you are using, but I am waiting for a Dev to respond to see if they can shine some light on it.

My very basic grasp of it is that it may have something to do with an update to Omnisharp which means Omnisharp is not loading correctly. You could try running a script
and then going to View - Output (in VS Code - see image). Does it say anything about ‘could not locate MSBuild instance to register Omnisharp’?

Example of error message I was getting before ‘solution’:

I would recommend posting a new topic with your problem - so they can respond directly to you.

Also, if the ‘Use Modern NET’ didn’t work for you I would suggest returning it to false - as that is the setting recommended by the Devs.

I can’t really help any more than that as I have only been doing this Unity/Coding stuff for a few weeks…

Good luck…and I’ll keep an eye on your post if you make a new topic. Googling the error message revealed a number of people experiencing problems with Intellisense not working in recent months.

1 Like

after some more googling, i just moved to visual studio community as its basically the same thing and intellisense works there .

1 Like

Okay - that’s good to know, just in case my VS Code stops behaving

Cheers

1 Like

I’m glad you managed to fix the problem. :slight_smile:

By the way, we got the information that did not work for you from the official VS Code website:

  1. In the VS Code Settings editor (Ctrl+,), uncheck the C# extension’s Omnisharp: Use Modern Net setting ( "omnisharp.useModernNet": false ).

If enabling omnisharp.useModernNet fixed the problem for you, keep it enabled. In the end, Unity does not use VS Code but the code. And the code is nothing but text. How you created the text is irrelevant as long as the code and the fileformat are correct. :slight_smile:


See also:

1 Like

Hi Nina,

Thanks for your help. I wasn’t making a criticism of GameDev, just pointing out to anyone following the post that what I was doing was contrary to the official guidance. I can’t remember why I tried it - I think it was a suggestion in some forum.

I still don’t understand why it works. Reading a bit more about the Omnisharp update (which occurred in May 2022) it states the following:

*.NET Framework builds of OmniSharp no longer ship with Mono or the MSBuild tooling (See announcement omnisharp-roslyn#2339). To ensure that the C# extension remains usable out of the box for .NET SDK projects, we have changed the default value of omnisharp.useModernNet to true .
*> *

So…that seems to suggest it should work with Unity with the setting to false. But how would that solve the error I was getting regarding MSBuild not registering (because it couldn’t be located)? And…how come it works in Unity with the setting to true?

Also, how would I ‘restart Omnisharp’?

I was just hoping there might be a logical reason why it wasn’t working and now it is?

‘In the end, Unity does not use VS Code but the code.’ What about Omnisharp? What is the relationship between VSCode / Unity and Omnisharp? Could this be a clue? I have no idea and probably won’t understand your answer…:slight_smile:

I know…lots of questions…and maybe I don’t need to know at this stage, just be glad it works!

1 Like

A couple of days ago, a Unity employee posted the following in the official Unity forum:
http://forum.unity.com/threads/update-on-the-visual-studio-code-package.1302621

From what I read, Unity plans to disable the plugin in newer versions of Unity, and you’ll have to manually install it. They also mentioned that the package had not been updated for years. In the tech field, this information usually translates to “the technology is basically dead”. Of course, “usually” does not mean “always”.

I was just hoping there might be a logical reason why it wasn’t working and now it is?

There certainly is but unless you are eager to read ten thousands of lines of code, it’ll remain a mystery. The comment in the official Unity forum mentions that the VS Code Editor plugin is open source. It might be this one.

maybe I don’t need to know at this stage, just be glad it works!

That’s probably the best idea because we do not know the answer either and do not have time to debug any Unity packages, let along VS Code. :confused:


For information on Omnisharp, please refer to their official website. VS Code is just a script editor. It is not C#.

OmniSharp is a set of tooling, editor integrations and libraries that together create an ecosystem that allows you to have a great programming experience no matter what your editor and operating system of choice may be.

To restart Omnisharp, follow this instruction. I found it after I searched for “VS Code restart omnisharp” on the internet.

2 Likes

Hi Nina,

Thanks for the comprehensive reply. I read the discussion linked and it doesn’t sound like good news for VS Code and Unity.

This plugin was a result of one of our hackweek experiments by a few of our former employees.

…that is a bit of an eye opener (sounds very casually thrown together)

Also this:

Unfortunately, it’s never been fully functional and hasn’t received any updates for almost two years, bringing you an unstable coding experience.

As for reading thousands of lines of code…I’ll probably give that a miss :slight_smile: …one line is challenging enough at the moment.

I think I might just change to Virtual Studio Community Edition (and hope to heck that works for me :slight_smile: ). Not much point in getting used to VS Code if it’s not supported and doesn’t always work?

I’m assuming VSCE would be closest to VS Code, rather than Rider? I’m thinking I’d like my code to look as close to the lecturer’s as possible (later on, it won’t matter as much…if I get that far :slight_smile: ).

It’s somewhat consoling that there are definite issues arising with VS Code working with Unity, and it’s not just me.

I’ve learnt quite a bit through this, but I’m not sure how useful the post will be to other students? Maybe, just to conclude: try a few things and if it doesn’t work go for VSCE. Also…the internet is our friend (I should’ve just googled restart Omnisharp!).

Well…we sort of solved it

Many thanks,

Rob

1 Like

I usually recommend VS (Community Edition) because I have used it for many years to write C# code. It basically works out of the box, and, unlike Rider, VS is free for most people. It’s disadvantage is that it is very large compared to VS Code and it has got many tools you will probably never use.

Just to ensure there is no misunderstanding: VS Code is a good piece of software. I use it for web development and sometimes for quickly editing a C# script if I’m too lazy to open VS, which loads more slowly than VS Code.

Regarding Rider, if you know Rider or even have an active subscription, you may use it. From what I heard, that’s a good IDE, and it works well with Unity. The disadvantage is that it costs money. That’s why I usually do not recommend it unless students mention it themselves. We aim to make our courses accessible for as many people as possible, that’s why we try to use free software and assets if possible.

I’ve learnt quite a bit through this, but I’m not sure how useful the post will be to other students?

You are definitely not the only one experiencing problems with VS Code, so other students will very likely find this discussion helpful. I’m glad Unity finally addressed the problems with VS Code. Another student posted the link today in the Q&A section over on Udemy, and I copied the link and posted it here. :slight_smile:

1 Like

Thanks for your support and the tips.

1 Like

I ran into this today. Yesterday I had Intellisense, and today I didn’t. Turns out that somehow Visual Studio Code / Omni no longer knew where mono was installed. (I suspect because VSCode was opened from Unity, and when I started Unity yesterday it didn’t know where mono was in the Path).

I restarted Visual Studio Code myself, and then Omni worked properly.

1 Like

Thanks - that’s handy to know if I encounter the problem again

1 Like

Hi Roba,

Thanks for your update. I am following Rick’s Project Boost module today, and I had the same issue. I did a lot of research online but still can’t solve the problem. Luckily, I got here. Your update totally changed my situation lol!

1 Like

For any future reference, like Nina said,

make sure you get the Developer Pack, I use VS community, and for a long time I didn’t know how to access intelisense, but getting the Dev Pack fixed it.

Privacy & Terms