IDE & Intellisense - Unable to set-up correctly

Greetings,

I am having a lot of trouble getting off the ground and starting my course.

I have tried to troubleshoot myself for several hours and not had any success so far. I have had a browse through similar topics and tried the suggested steps and I’m still not getting anywhere.

I am going around in circles and could do with some help.

The problem:

Intellisense will not work.

What I have tried so far:

  1. Using Visual Studio Community 2019 + Unity Tools
  2. Using Visuall Studio Community 2022 + Unity Tools
  3. VSCode.

Installing C#, and code snippets extensions for VSCode.

Regenerating all project files, after selecting the appropriaate editor in Unity Preferences.

In unity under editor - external tools:

Reset Arguement.
Regenerate Project Files.

Manually uninstalling & reinstalling IDE’s.
Installing new build of Unity.

Installing .Net Framework 5.0
Installing .Net Developer Framework 4.7.1

If trying to get VSCode up and running, I have followed the steps @ Visual Studio Code and Unity

If trying to use VirtualStudio - tried the steps at Quickstart: Install & configure Visual Studio Tools for Unity | Microsoft Docs

I really don’t know what else to try.

In my VSCode OmniSharp - I get the following warnings:

OmniSharp.CompositionHostBuilder

"It looks like you have Visual Studio 2019 installed without .NET Core SDK support which is required by OmniSharp.

Try updating Visual Studio 2019 installation with .NET Core SDK to enable better MSBuild support. OmniSharp.CompositionHostBuilder"

If I uninstall, repair or reinstall .NET 5.0SDK and Developer 4.7.1 - these meessages still appear.

Does anybody have some suggestions?

Thank you in advance

Edit:

I was able to resolve the omnisphere log warning by using visual studio installer - modify - selecting desktop components - optional and ticking on the individual component.

Still not working properly with Unity though.

Hi,

Welcome to our community! :slight_smile:

Thanks a lot for sharing what you already tried to no avail. That’s helpful.

Which operating system and which version of Unity do you use? Do you use an antivirus program or a firewall that might be blocking VS?

I also have a question regarding this part:

In my VSCode OmniSharp - I get the following warnings: OmniSharp.CompositionHostBuilder

"It looks like you have Visual Studio 2019 installed without .NET Core SDK support which is required by OmniSharp.

Try updating Visual Studio 2019 installation with .NET Core SDK to enable better MSBuild support. OmniSharp.CompositionHostBuilder"

Did you get these messages in VS Code?

I’m asking because VS Code and Visual Studio (VS) are two different programs. If you actually meant to write VS, close Unity and VS. Then go to your project folder and delete the *.csproj and *.sln files. Launch Unity again. Double click on your script in the Unity Assets folder and have Unity open VS.

If the issue persists, please share a screenshot of the console in VS if there are messages in it.

Hi Nina,

Thanks for your response.

Those errors were when using VSCode.

I have completely uninstalled VSCode and Visual Studio since then to see if I could get it working using Visual Studio instead.

I am using Microsoft Windows 10 Pro - Version 10.0.19044 Build 19044

I have tried manually deleting all vs code, library, .sln and .csproj files and forcing a manual rebuild on launch to no avail.

I have tried installing with only basic Windows Defeder set-up and the issue persists so I do not think it is a firewall or av issue.





As for Unity versions I have tried two different LTS branches with no success.

I’ve also attached a copy of Unity Console errors - please not that I have tried deleting the script or commenting out errors to exit safe mode and recompile and no luck there either.

Even on a brand new project if I create a new script from scratch I experience the same issues.

I’m not sure if I misunderstood your problem but the error message in your Unity console does not have anything to do with VS. That’s a compiler error. The xValue variable is declared within the code block of the Start method. This means the Update method cannot access the variable. The variable needs to be declared at instance level meaning outside another method. Have you already compared your code to the Lecture Project Changes which can be found in the Resources of this lecture?

Before you install/uninstall things, please fix the problem in your code. Then save your code and close Unity and VS. Then launch Unity again.

Did that fix your problem?

Hi Nina,

Sorry that’s an error on my part from deleting and recreating the script multiple times when troubleshooting.

Even with a working script and no compiler errors - I still do not get the correct intellisense formatting.

This script is attached to a game object and works correctly - but you’ll see that my Visual Studio window does not correctly highlight with Syntax Highliting on translate. Or give proper highlighting on the methods Start and Update.

I hope that makes more sense and clarifies my issue.

Thanks for your input

Just to double check - I went to the resoruces and used the script there - and the same syntax issues are present.

P.S Thanks for the hint on resources tabs - I hadn’t noticed the attached scripts. Thank you for pointing it out.


Sorry if I’m appearing slightly dumb but your screenshots of VS looks perfectly fine to me. The syntax highlighting is working: The method names and types are blue, the classname is cyan, called methods yellow, values yellow, variables white. I use the same colour scheme, and my scripts look exactly the same as yours regarding the syntax highlighting.

If you use another script editor (e.g. VS, Rider, VS Code, Atom) or another colour scheme, the tinting of your code might look different. As long as you see different colours, the syntax highlighting is working. You could change the colour scheme if you want. See this thread.

Usually, when there is a problem witht the syntax highlighting with C# scripts in VS, the inherited classname would be white. In your case, MonoBehaviour is cyan as it is supposed to be.

image

To test if IntelliSense and the code suggestions work, start typing “game” or something like that inside the code block of the Start method. You should get suggestions such as gameObject. Outside the method, you could type “OnCol”, and you should get suggestions like “OnCollisionEnter”. If you get them, IntelliSense and the code suggestions work.

And the compiler works properly if it underlines compiler errors in your code:

image

If you feel that I misunderstood your problem, could you please share a screenshot of what you would like to see or expected to see on your screen? What makes you think that something must be wrong in your case?

Hi Nina,

I was not getting suggestions for gameobject, on colllsion enter, or auto complete for variables.

E.g - if I typed transform.Translate - and started to type xVa - It was not suggesting xValue as it should.

I have since managed to resolve this.

I am unsure which step fixed my issue - but in case anybody vists the thread in the future and has a similar problem these are the steps I took to get everything working correctly.

I tried using Visual Studio instsaller to repair installations.

I tried using Visual Studio installer to remove installations.

I used the Remove All InstallCleanup.exe

I manually uninstalled any remaining traces of Visual Studio.

I removed all Visual Studio Redistributables manually using add/remove programs.

I ran the .NET Uninstall tool - at Uninstall Tool - .NET | Microsoft Docs

I deleted all Visual Studio folders inside Programs(x86), Programs, and the hidden APPData folders.

I deleted all dot net folders.

I deleted all Microsoft SDK folders.

I cleared windows temp data.

I fullly uninstalled all Unity installations (backing up projects into archivers first)

I removed Unity Hub.

I reinstalled Unity and the latest LTS build.

I used add components from Unity Hub - Manage Installs - to reinstall Visual Studio 2019 and the Unity Tools.

I am now getting correct predictions when typing Unity Related code.

I am happy to say I am able to crack on with the course.

Hopefully my future posts will be more about theory and sharing my work and ideas.

Feel free to close the thread and sorry if I was being a bit dense at times.

Thanks again for your help and guidance

Awesome! Thanks a lot for sharing what you did even if you were not able to figure out what exactly fixed the problem for you. I’m sure your thread will help future students. :slight_smile:

I’m marking your last answer as the solution now. The thread will automatically close 24h after the last reply.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms