Nodachisoft Nodachisoft logo, Katana Sword Icon
  
@Amaji✎ Update December-25-2021

In Unity + VSCode, Fixed vscode intellisense not working.

In Unity + VSCode, Fixed vscode intellisense not working.

Summury Of Article

When I created a new Unity 2020.3 LTS + VSCode environment and started coding, I solved the problem that code completion (Intellisense) did not work in VSCode, so I will write down the solution.

My Enviroment

Software Version
Unity Unity2020.3 LTS
OS Windows 10 Home
VSCode 1.63.2

Symptoms

I've already installed the following as an extension to VSCode, which is suitable for coding with Unity. The following are already installed.

Installed VSCode Extension

In this state, when I open the code from Unity, Intellisense (code completion, etc.) does not work.

For example, creating a new scripting file (cs file) in unity. In the void Start() method, type this.game and then Ctrl + Space. It should show this.gameObject as a candidate, but it doesn't.

Here's what happens when the candidate is displayed (ideally).

ideal

Fix

Open it as a project in VSCode properly from Unity. (It is assumed that opening VSCode from Unity is pre-associated.)

Open vscode project from Unity

Asset -> Open C# Project

The following error was displayed in the "Output" tab of VSCode.

errormessage
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\myunityproject\Assembly-CSharp.csproj'.
c:\myunityproject\Assembly-CSharp.csproj
c:\Users\amaji\.vscode\extensions\ms-dotnettools.csharp-1.23.17
  \.omnisharp\1.37.17\.msbuild\Current\Bin
  \Microsoft.Common.CurrentVersion.targets(1217,5):
    Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found.
    To resolve this, install the Developer Pack (SDK/Targeting Pack)
    for this framework version or retarget your application.
    You can download .NET Framework Developer Packs at
    https://aka.ms/msbuild/developerpacks

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded:
         c:\myunityproject\Assembly-CSharp.csproj

The Error message said: "NETFramework Version=v4.7.1 is not found".

okay then, Download & install it from the official website.

Microsoft Official - .NET Framework Version 4.7.1 Download Page - . https://dotnet.microsoft.com/en-us/download/dotnet-framework/net471

Download Page

Install the Download .NET Framework 4.7.1 Developer Pack.

After the installation, from Unity again Asset -> Open C# Project to open the project, and the completion is now working properly.

Congratulations and thank you.

Page History

date modification
none
 
 
Message sent

Thank you for your message.

Something error has occured!

Sorry. The Error has occurred.We apologize for the inconvenience.Please try again in a few minutes or contact us via DM below.

Twitter:@NodachiSoft_eng
Name:
 
Replay To:
 
Message:
 
Back
Check the content!

Send the following information to us. If you are happy with your submission, please click "Send". If you want to modify it, please click "Back".

Name:
 
Reply To:
 
Message:
 
Enter a confirmation key to make sure that you are not operating from a Robot.
Confirmation Key is 95
Back
 / 
Go to Confirmation
Entry fields
Go to Confirmation

There are 5 articles that may be relevant!

System.Type.GetType returns null in Unity C# code

System.Type.GetType returns null in Unity C# code

#Unity#.net✎ 2022-1-11
System.Type.GetType returns null in Unity C# code
Table Of Contents
In Unity + VSCode, Fixed vscode intellisense not working.
In Unity + VSCode, Fixed vscode intellisense not working.
Summury Of Article
Summury Of Article
My Enviroment
My Enviroment
Symptoms
Symptoms
Fix
Fix
Page History
Page History
Nodachisoft © 2021