由于Windows每天给我带来新的问题,我永久地迁移到Linux (Kubuntu22.04LTS)。但是在使用Unity时,VS代码并没有为我提供Intellisense。
在我的系统中:安装了mono-complete dotnet-sdk-6.0 && aspnetcore-runtime-6.0包
在VS代码中:安装了"C#扩展“
案I:-
omnisharp.useModernNet: false
输出
Starting OmniSharp server at 26/6/2022, 2:58:43 pm
Target: /home/anany-aadil/Desktop/UnityProjects/3D Shooter/3D Shooter.sln
OmniSharp server started with Mono 6.8.0.
Path: /home/anany-aadil/.vscode/extensions/ms-dotnettools.csharp-1.25.0-linux-x64/.omnisharp/1.39.0/omnisharp/OmniSharp.exe
PID: 34448
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on ubuntu 22.4 (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 0 MSBuild instance(s)
Could not locate MSBuild instance to register with OmniSharp.
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).案例2:-
omnisharp.useModernNet:真
输出
Starting OmniSharp server at 26/6/2022, 3:10:09 pm
Target: /home/anany-aadil/Desktop/UnityProjects/3D Shooter/3D Shooter.sln
OmniSharp server started with .NET 6.0.301
.
Path: /home/anany-aadil/.vscode/extensions/ms-dotnettools.csharp-1.25.0-linux-x64/.omnisharp/1.39.0-net6.0/OmniSharp.dll
PID: 35601
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Unknown 0.0 (Unknown)
[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.301 17.2.0 - "/usr/share/dotnet/sdk/6.0.301/"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "/usr/share/dotnet/sdk/6.0.301/"
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/home/anany-aadil/Desktop/UnityProjects/3D Shooter/3D Shooter.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/anany-aadil/Desktop/UnityProjects/3D Shooter'.
[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 '/home/anany-aadil/Desktop/UnityProjects/3D Shooter' on host 35481.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp.csproj'.
/home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp.csproj
/usr/share/dotnet/sdk/6.0.301/Microsoft.Common.CurrentVersion.targets(1221,5): Error: This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp-Editor.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp-Editor.csproj'.
/home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp-Editor.csproj
/usr/share/dotnet/sdk/6.0.301/Microsoft.Common.CurrentVersion.targets(1221,5): Error: This project targets .NET version that requires reference assemblies that are not installed (e.g. .NET Framework). The most common solution is to make sure Mono is fully updated on your machine (https://mono-project.com/download/) and that you are running the .NET Framework build of OmniSharp (e.g. 'omnisharp.useModernNet': false in C# Extension for VS Code).
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/anany-aadil/Desktop/UnityProjects/3D Shooter/Assembly-CSharp-Editor.csproj有什么解决办法吗?谢谢
发布于 2022-06-28 13:40:40
好的,我解决了这个问题。
我所做的就是删除微软的dotnet包(sdk & runtime),并安装了snap版本。
我也完全删除了mono-complete,并重新安装了它和Voila!它现在起作用了谢谢
https://stackoverflow.com/questions/72760451
复制相似问题