So, I’m kind of new to coding. I’m making a game in Unity and I just got to scripting. Unfortunately, VScode is not working with me. I’ve installed the latest C# extension in VScode and .NET version is 6.0.401.
Whenever I boot up the IDE I get an error message
Some projects have trouble loading. Please review the output for more details.
Source: C# (Extension)
When I check the output, this is what it says:
Target: c:UsersDrewsMy project
OmniSharp server started with .NET 6.0.401
.
Path: c:UsersDrews.vscodeextensionsms-dotnettools.csharp-1.25.0-win32-
x64.omnisharp1.39.0-net6.0OmniSharp.dll
PID: 6088
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 10.0.22000.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 6.0.401 17.3.1 - "C:Program Filesdotnetsdk6.0.401"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.401 17.3.1 - "C:Program
Filesdotnetsdk6.0.401"
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider:
OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:UsersDrewsMy projectMy project.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:UsersDrewsMy projectUnityEngine.UI.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:UsersDrewsMy projectAssembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:UsersDrewsMy projectUnityEditor.UI.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:UsersDrewsMy project'.
[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:UsersDrewsMy project' on host
788.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:UsersDrewsMy projectUnityEngine.UI.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:UsersDrewsMy projectUnityEngine.UI.csproj'.
c:UsersDrewsMy projectUnityEngine.UI.csproj
C:Program Filesdotnetsdk6.0.401Microsoft.Common.CurrentVersion.targets(1220,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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:UsersDrewsMy projectAssembly-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:UsersDrewsMy projectAssembly-CSharp.csproj'.
c:UsersDrewsMy projectAssembly-CSharp.csproj
C:Program Filesdotnetsdk6.0.401Microsoft.Common.CurrentVersion.targets(1220,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
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:UsersDrewsMy projectUnityEditor.UI.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:UsersDrewsMy projectUnityEditor.UI.csproj'.
c:UsersDrewsMy projectUnityEditor.UI.csproj
C:Program Filesdotnetsdk6.0.401Microsoft.Common.CurrentVersion.targets(1220,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:UsersDrewsMy
projectUnityEngine.UI.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: c:UsersDrewsMy projectAssembly-
CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: c:UsersDrewsMy
projectUnityEditor.UI.csproj
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
Inlay hints requested for document not in workspace Location { FileName =
c:UsersDrewsMy projectAssetsScriptsPlayer.cs, Range = Range { Start = Point { Line
= 0, Column = 0 }, End = Point { Line = 23, Column = 0 } } }
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
Inlay hints requested for document not in workspace Location { FileName =
c:UsersDrewsMy projectAssetsScriptsPlayer.cs, Range = Range { Start = Point { Line
=
0, Column = 0 }, End = Point { Line = 23, Column = 0 } } }
Also, the intellisense isn’t working so I have to type things in manually. I am not nearly sane or smart enough to try to fix it. If any more info is needed, I will provide.
2
Answers
I don’t know why this isn’t answered yet but
to make it as simple as possible
unity does not use the latest version of .net
yet it still directs you to the link of the latest
but it’s written in the log that it’s looking for version 4.7.1
download it from here my brother
(download the devPack then restart ur pc)
https://dotnet.microsoft.com/en-us/download/dotnet-framework/net471
You need the Dot net developer pack version 4.7.1(not the runtime version) for VScode to work properly with Unity.
Make sure you close Vscode and Unity while installing the developer pack.