全曲未正确加载 - 视觉工作室代码和统一性
当我尝试在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
“我可以解决此问题吗?”
是的,只需设置
OmnishArp.usemodernnet
属性属性。"Can I fix this?"
Yes, just set
omnisharp.useModernNet
property to false.控制台所说的问题(感谢您指出我检查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.
我在Mac上遇到了类似的问题,最终,我通过按照以下步骤进行了修复:
禁用
Omnisharp.usemodernnet
属性,通过将其设置为false。。
文件,尽管使用了M1 Apple Mac。
删除所有C#相关的扩展名并重置所有设置。
重复步骤1通过设置
OmnishArp.usemodernnet
再次为false。执行这些步骤后,解决了问题!
mono(Mac): https://www.mono-project.com/download/预览
msbuild工具(Windows):https://visualstudio.microsoft.com/downloads/#build- Vist-for-Visual-Studio-2022
我希望这种解释证明对其他遇到类似问题的人有帮助。
I encountered a similar problem on my Mac and eventually, I managed to fix it by following these steps:
Disable the
omnisharp.useModernNet
property by setting it to false.files, despite using an M1 Apple Mac.
Remove all C#-related extensions and reset all settings.
Repeat step 1 by setting
omnisharp.useModernNet
to false again.After performing these steps, the problem was resolved!
Mono(mac): https://www.mono-project.com/download/preview
MSBuild Tools(windows): https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
I hope this explanation proves helpful to others experiencing a similar problem.