I am learning Unity and I am trying to get IntelliSense to work for C#, but every time I launch VS Code it gives me an error on the bottom right saying:
Some projects have trouble loading. Please review the output for more details.
Output:
Starting OmniSharp server at 1/12/2023, 9:54:47 PM
Target: c:\Users\Super Bub\Desktop\Test_Multiplayer\Test_Multiplayer.sln
OmniSharp server started with .NET 7.0.100
.
Path: c:\Users\Super Bub\.vscode\extensions\ms-dotnettools.csharp-1.25.2-win32-x64\.omnisharp\1.39.2-net6.0\OmniSharp.dll
PID: 2360
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 10.0.19044.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 7.0.100 17.4.0 - "C:\Program Files\dotnet\sdk\7.0.100\"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 7.0.100 17.4.0 - "C:\Program Files\dotnet\sdk\7.0.100\"
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\Super Bub\Desktop\Test_Multiplayer'.
[info]: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\Users\Super Bub\Desktop\Test_Multiplayer\Test_Multiplayer.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Super Bub\Desktop\Test_Multiplayer\Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\Super Bub\Desktop\Test_Multiplayer'.
[info]: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\Super Bub\Desktop\Test_Multiplayer' on host 20368.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Super Bub\Desktop\Test_Multiplayer\Assembly-CSharp.csproj
[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
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\Users\Super Bub\Desktop\Test_Multiplayer\Assembly-CSharp.csproj'.
c:\Users\Super Bub\Desktop\Test_Multiplayer\Assembly-CSharp.csproj
C:\Program Files\dotnet\sdk\7.0.100\Microsoft.Common.CurrentVersion.targets(1229,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\Super Bub\Desktop\Test_Multiplayer\Assembly-CSharp.csproj
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
Inlay hints requested for document not in workspace Location { FileName = c:\Users\Super Bub\Desktop\Test_Multiplayer\Assets\Scripts\NetworkManagerUI.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 19, Column = 0 } } }
I have the latest version of .NET SDK installed and the C# extension aswell as the rest of my extensions are updated. I have tried re-installing .NET SDK and VS Code but nothing works. omnisharp.useModernNet is set to true in settings and my External Script Editor is set to Visual Studio Code. I am using Windows 10. I got intellisense to work on a different computer that I can't use often, so not having it now is very frustrating.
Thanks for any help.
CodePudding user response:
try older versions of OmniSharp extension
CodePudding user response:
My .NET SDK version wasn't the correct one. IntelliSense worked after following this tutorial: https://vionixstudio.com/2021/11/02/unity-visual-studio-code/