question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

intellisense doesn't work in vs code for unity

See original GitHub issue

Hello there,

I have .net 6 sdk installed and have configured all the settings mentioned in the vs code extension yet Im still getting these errors. I am on windows 10.

here’s my error message:

[fail]: OmniSharp.MSBuild.ProjectLoader
        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
c:\Users\Leo Zhang\Documents\GitHub\ARHW1\VuforiaPackageTests.csproj
C:\Program Files\dotnet\sdk\6.0.102\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:\Users\User1\Documents\GitHub\ARHW1\UnityEngine.UI.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\User1\Documents\GitHub\ARHW1\VuforiaScripts.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\User1\Documents\GitHub\ARHW1\Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\User1\Documents\GitHub\ARHW1\UnityEditor.UI.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\User1\Documents\GitHub\ARHW1\VuforiaEditorScripts.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\User1\Documents\GitHub\ARHW1\Assembly-CSharp-Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\User1\Documents\GitHub\ARHW1\VuforiaPackageTests.csproj

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
esklarskicommented, Feb 25, 2022

The instructions in VS code says set omnisharp.useModernNet to true for .net 6 builds tho. Either way, I tried setting it to false and it didn’t work. Also I am trying to avoid using visual studio and just use vs code. Can you please show me how I can do that? Thanks.

Try closing VS Code and Unity, then open your project folder and delete the .sln and .csproj files therein. Next open the project in Unity and once that loads reopen VS Code. I find nuking those files and forcing a regen is the only thing that ever works for me.

0reactions
leozhang1commented, Feb 27, 2022

The instructions in VS code says set omnisharp.useModernNet to true for .net 6 builds tho. Either way, I tried setting it to false and it didn’t work.

Unless there have been recent changes, Unity projects are not .NET SDK projects. The net6 build of OmniSharp will not load Full Framework projects.

Also I am trying to avoid using visual studio and just use vs code. Can you please show me how I can do that? Thanks.

The reason you need the Visual Studio MSBuild Tools is to get a build environment that supports .NET 4.7.1 Full Framework projects. The C# extension does not support all Full Framework project types out of the box.

That’s unfortunate that the extension doesn’t support it yet, but I’m sure the team is working hard! I installed the msbuild tools like you said and though I’m not entirely sure if that fixed the issue, the visual studio ide did redirect me to this link https://dotnet.microsoft.com/en-us/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral after telling me that I have v4.6.1 and that vuforia uses v4.7.1, so I went ahead and got that and now intellisense is working again in vs code despite a new error: [fail]: OmniSharp.MSBuild.ProjectLoader The reference assemblies for .NETFramework,Version=v4.6.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 c:\Users\User1\Documents\GitHub\ARHW1\Assembly-CSharp-Editor.csproj it seems I cant please everyone, but at least intellisense is back, so I’m good for now. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intellisense not working for Visual Studio Code
Problem: 1. Intellisense and Autocomplete not working for VScode. 2. Opening c# script within the editor opens VSCode. However, VScode Doesn't ...
Read more >
Visual studio code autocomplete/intelliSense not working ...
Close both Unity and VScode. · If you are on Windows, Download and install . · Open Unity. · Go to Edit>Preferences>External tools....
Read more >
c# - Visual studio code Intellisense not working with Unity ...
Close the Visual Studio. · Open the unity Preferences from the toolbar and select the external tools. · Then, External Script Editor chose...
Read more >
Visual Studio Code and Unity
Open up Unity Preferences, External Tools, then browse for the Visual Studio Code ... packs required for Unity's code-completion (IntelliSense) in VS Code....
Read more >
Intellisense in VS code unity doesn't work - Ask
Uninstall Visual Studio Code. Then reinstall it. If you are lucky, it detected the .NET Framework 4.7.1 correctly. Regarding the version of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found