无所不能的C#不在Ubuntu上工作22.04与Unity合作

发布于 2025-02-10 18:53:38 字数 6370 浏览 3 评论 0原文

由于窗户每天给我带来新的问题,我永久搬到了Linux(Kubuntu 22.04 LTS)。但是,在与Unity编辑器合作时,VS代码并不能为我提供Intellisense。

在我的系统中: 单核算 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:true

输出

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

是否修复?谢谢

Due to Windows giving me new problems day by day, I permanently moved to Linux (Kubuntu 22.04 LTS). But while working with Unity Editor, VS Code doesn't provide me with Intellisense.

In My System:
mono-complete
dotnet-sdk-6.0 && aspnetcore-runtime-6.0 packages are Installed

In VS Code:
"C# Extension" is Installed

Case I:-

omnisharp.useModernNet: false

Output:

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).

Case 2:-

omnisharp.useModernNet: true

Output:

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

Any Fix? Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人心善变 2025-02-17 18:53:38

好的,我解决了问题。

我所做的是删除dotnet(SDK& runtime)的Microsoft软件包,并安装了SNAP版本。

而且我还完全删除了mono-complete,然后再次安装了它,
瞧!
现在起作用
谢谢

Ok I have solved the problem.

what I did was to remove the Microsoft Package of dotnet (sdk & runtime) and installed the snap version.

And I also completely removed mono-complete and installed it again and
Voila!
It works now
Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文