全曲未正确加载 - 视觉工作室代码和统一性

发布于 2025-02-13 00:22:11 字数 4512 浏览 0 评论 0原文

当我尝试在VSCODE中打开Unity脚本时,我会收到错误消息一些项目很难加载。请查看输出以获取更多详细信息。。当我选择显示输出时,我会得到此输出:

Starting OmniSharp server at 7/5/2022, 6:09:26 PM
    Target: /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/First Unity Game.sln

OmniSharp server started with .NET 6.0.301
.
    Path: /Users/angelalindsay/.vscode/extensions/ms-dotnettools.csharp-1.25.0-darwin-x64/.omnisharp/1.39.0-net6.0/OmniSharp.dll
    PID: 2949

[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/local/share/dotnet/sdk/6.0.301/"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "/usr/local/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 '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/First Unity Game.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game'.
[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 '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game' on host 2915.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/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 '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj'.
/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj
/usr/local/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: /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
        Inlay hints requested for document not in workspace Location { FileName = /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assets/Scripts/WayPointFollower.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 21, Column = 0 } } }
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
        Inlay hints requested for document not in workspace Location { FileName = /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assets/Scripts/WayPointFollower.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 21, Column = 0 } } }

我不知道这是否相关,但是,Unity的自动完成也不在VSCODE中工作。我能够键入代码,并且可以团结起作用,但我想自动完成并摆脱此错误消息。我可以解决这个问题吗?谢谢。

When I try to open a unity script in vscode, I get an error message Some projects have trouble loading. Please review the output for more details.. When I select Show Output, I get this output:

Starting OmniSharp server at 7/5/2022, 6:09:26 PM
    Target: /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/First Unity Game.sln

OmniSharp server started with .NET 6.0.301
.
    Path: /Users/angelalindsay/.vscode/extensions/ms-dotnettools.csharp-1.25.0-darwin-x64/.omnisharp/1.39.0-net6.0/OmniSharp.dll
    PID: 2949

[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/local/share/dotnet/sdk/6.0.301/"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: .NET Core SDK 6.0.301 17.2.0 - "/usr/local/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 '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/First Unity Game.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game'.
[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 '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game' on host 2915.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/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 '/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj'.
/Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj
/usr/local/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: /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assembly-CSharp.csproj
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
        Inlay hints requested for document not in workspace Location { FileName = /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assets/Scripts/WayPointFollower.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 21, Column = 0 } } }
[warn]: OmniSharp.Roslyn.CSharp.Services.InlayHints.InlayHintService
        Inlay hints requested for document not in workspace Location { FileName = /Users/angelalindsay/Desktop/Unity Projects/First Unity Game/First Unity Game/Assets/Scripts/WayPointFollower.cs, Range = Range { Start = Point { Line = 0, Column = 0 }, End = Point { Line = 21, Column = 0 } } }

I don't know if this is related or not but, the autocomplete for unity is not working in vscode either. I'm able to type code and it works in unity but I would like to have autocomplete and get rid of this error message. Can I fix this? Thanks.

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

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

发布评论

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

评论(3

迷乱花海 2025-02-20 00:22:11

此项目目标.NET版本需要参考组件
未安装的(例如.NET框架)。最常见的解决方案
是为了确保单声道在机器上已完全更新
https://mono-project.com/download/ ),并且您正在运行。网
Omnisharp的框架构建(例如'omnisharp.usemodernnet':false in
c#vs代码扩展)。

“我可以解决此问题吗?”

是的,只需设置OmnishArp.usemodernnet属性属性。

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

"Can I fix this?"

Yes, just set omnisharp.useModernNet property to false.

羅雙樹 2025-02-20 00:22:11

控制台所说的问题(感谢您指出我检查OmnishArp的控制台),您没有OmnishArp插件期望的.NET版本。

我通过安装旧版本的扩展名来解决问题,因为MU项目正在使用.NET 5,并且该扩展程序的更新版本正在搜索.NET 6。

我不确定您是否可以设置每个项目的.NET版本 - 可能是可能但是找不到方法。

The problem as the console says (thanks for pointing me to check omnisharp's console) is that you don't have the version of .NET which the omnisharp plugin expects.

I solved the issue by installing older version of the extension as mu project was using .NET 5 and the updated version of the extension was searching for .NET 6.

I am not sure if you can set the .NET version per project - probably but didn't find a way.

仄言 2025-02-20 00:22:11

我在Mac上遇到了类似的问题,最终,我通过按照以下步骤进行了修复:

  1. 禁用Omnisharp.usemodernnet属性,通过将其设置为false。

    • 最初,我遇到了与某些EXE有关的奇怪错误
      文件,尽管使用了M1 Apple Mac。
    • 最终,我意识到仅通过更改设置解决问题是不可能的。
  2. 删除所有C#相关的扩展名并重置所有设置。

  3. 重复步骤1通过设置OmnishArp.usemodernnet再次为false。

执行这些步骤后,解决了问题!

值得注意的是,在以前发生此问题的情况下,我
只需重新安装C#扩展要求即可。对于Windows,
这涉及安装.NET框架和MSBUILD工具,而
对于MacOS/Linux,它需要使用msbuild的单声道。

我希望这种解释证明对其他遇到类似问题的人有帮助。

I encountered a similar problem on my Mac and eventually, I managed to fix it by following these steps:

  1. Disable the omnisharp.useModernNet property by setting it to false.

    • Initially, I encountered a strange error related to some exe
      files, despite using an M1 Apple Mac.
    • Eventually, I realized that resolving the issue solely through changing settings was unlikely.
  2. Remove all C#-related extensions and reset all settings.

  3. Repeat step 1 by setting omnisharp.useModernNet to false again.

After performing these steps, the problem was resolved!

It's worth noting that during a previous occurrence of this issue, I
simply had to reinstall the C# extension requirements. For Windows,
this involved installing the .NET Framework and MSBuild Tools, while
for macOS/Linux, it required Mono with MSBuild.

I hope this explanation proves helpful to others experiencing a similar problem.

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