I get this message in the output of VSCode
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for framework ".NETFramework,Version=v4.7.1" were not found.
To resolve this, install the SDK or Targeting Pack for this framework version
or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the
Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
this is what my dotnet
output looks like
~ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.2.106
Commit: aa79b139a8
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/2.2.106/
Host (useful for support):
Version: 2.2.4
Commit: f95848e524
.NET Core SDKs installed:
2.2.106 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
With this error I can't get any IDE features for C# in VSCode.
Close VS Code.
Download and install Microsoft .NET Framework 4.7.1 .
Download and install Microsoft's .NET Framework SDK any version with start 4.X
In VS Code, open Assembly_CSharp.csproj
file and change TargetFrameworkVersion
to what you installed .NET Framework SDK version.
You should have both .NET framework and targeting sdk installed for a particular version.
This is a temporary solution because targetFrameworkVersion
always changes to unity defaults when you close the editor
Install latest stable Mono Version should fix the issue for this one, if anyone faces a similar issue.
Or try a different one until it is resolved, might be some mono versions preventing this.
The following worked for me (Unity 2022.3.3f1):
OUTPUT
tab of VSCode as the version of C# you are using with unity.)
ndp471-devpack-enu.exe
dotnet
to your PATH and get VSCode to recognize it. Omnisharp/Intellisense did not work for me without this step.
dotnet-sdk-6.0.300-win-x64.exe
Visual Studio Code
is the External Script Editor. Press Regenerate project files
You shouldn't need to change settings.json
or anything else
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.