OmniSharp.MSBuild.ProjectManager 无法在 Linux 上加载项目
OmniSharp.MSBuild.ProjectManager Failed to load project on Linux
我正在我的 Manjaro Linux 笔记本上学习 C#。我尝试安装 ms-vscode.csharp 扩展,但在打开任何 .NET Core 项目时,我收到以下错误消息:
Some Projects have trouble loading. Please review the output for more
information.
我尝试将 VS Code 设置中的 "omnisharp.path"
选项设置为 "latest"
但它没有改变任何东西。
我使用的是 1.21.8 版的扩展和 1.40.2 版的 VS Code。
有解决问题的想法吗?
VS 代码错误日志:
Starting OmniSharp server at 12/3/2019, 1:16:18 PM
Target: /home/marco/dev/big-number
OmniSharp server started.
Path: /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/run
PID: 9119
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on manjaro 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.3 - "/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/marco/dev/big-number'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/marco/dev/big-number'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/marco/dev/big-number/big-number.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/marco/dev/big-number'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/marco/dev/big-number/big-number.csproj
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/marco/dev/big-number' on host 9016.
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/marco/dev/big-number/big-number.csproj'.
/home/marco/dev/big-number/big-number.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /home/marco/dev/big-number/big-number.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00254] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x0011c] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x0002f] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00093] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.<LoadProject>b__0 () [0x00000] in <d71b11425cc74bd5a2cb9780240c3208>:0
at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult()
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func`1[TResult] loader) [0x0001b] in <d71b11425cc74bd5a2cb9780240c3208>:0
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/marco/dev/big-number/big-number.csproj
我通过添加包含以下内容的 omnisharp.json
文件解决了这个问题:
{
"MSBuild": {
"UseLegacySdkResolver": true
}
}
您收到此错误的部分原因是您的项目中缺少 .vscode。 Omnisharp 寻找.Net SDK 版本的路径是错误的,这是因为Omnisharp 在Visual Studio 保存其资源的路径中寻找所需的SDK。要解决此问题,请更新您的 visual studio,使其具有您正在使用的最新 SDK 版本。这应该可以解决错误,您在 Visual Studio 代码上 运行 的项目将有 the.VSCode 文件夹。
要更新 Visual Studio,请打开顶部菜单中的 Visual Studio 和 select 帮助,查找“检查更新”,然后进行更新。
如果您当时已经完成所有这些操作,简单的 Vs Code 重启可能就是答案。
这似乎已经为我完成了
代码 -> 首选项 -> 设置 -> 单击此
;/ 希望我至少有 10 个声望 post 这里的图片但是它是右上角的第一个图标看起来像一张小纸片。
然后..
将意大利面复制到 settings.json
{
"explorer.compactFolders": false,
"update.mode": "none",
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"omnisharp.path": "latest",
"omnisharp.monoPath": "auto",
"csharp.semanticHighlighting.enabled": true,
"editor.formatOnType": true,
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
"settingsSync.ignoredExtensions": [],
"window.zoomLevel": 0
}
那个^
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
但我认为这就是我的诀窍 ^ 特别是 [csharp]
通过查看启动日志,我看到一条消息说我需要 .NET Developer Pack 4.7.1。
从 https://docs.microsoft.com/de-de/dotnet/framework/install/guide-for-developers 下载并安装 .NET Framework 4.7.1(开发包)解决了我的问题。
我正在我的 Manjaro Linux 笔记本上学习 C#。我尝试安装 ms-vscode.csharp 扩展,但在打开任何 .NET Core 项目时,我收到以下错误消息:
Some Projects have trouble loading. Please review the output for more information.
我尝试将 VS Code 设置中的 "omnisharp.path"
选项设置为 "latest"
但它没有改变任何东西。
我使用的是 1.21.8 版的扩展和 1.40.2 版的 VS Code。
有解决问题的想法吗?
VS 代码错误日志:
Starting OmniSharp server at 12/3/2019, 1:16:18 PM
Target: /home/marco/dev/big-number
OmniSharp server started.
Path: /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/run
PID: 9119
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on manjaro 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.3 - "/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/marco/dev/big-number'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/marco/dev/big-number'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/marco/dev/big-number/big-number.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/marco/dev/big-number'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/marco/dev/big-number/big-number.csproj
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/marco/dev/big-number' on host 9016.
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/marco/dev/big-number/big-number.csproj'.
/home/marco/dev/big-number/big-number.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /home/marco/dev/big-number/big-number.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00254] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x0011c] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x0002f] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00093] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.<LoadProject>b__0 () [0x00000] in <d71b11425cc74bd5a2cb9780240c3208>:0
at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult()
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func`1[TResult] loader) [0x0001b] in <d71b11425cc74bd5a2cb9780240c3208>:0
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/marco/dev/big-number/big-number.csproj
我通过添加包含以下内容的 omnisharp.json
文件解决了这个问题:
{
"MSBuild": {
"UseLegacySdkResolver": true
}
}
您收到此错误的部分原因是您的项目中缺少 .vscode。 Omnisharp 寻找.Net SDK 版本的路径是错误的,这是因为Omnisharp 在Visual Studio 保存其资源的路径中寻找所需的SDK。要解决此问题,请更新您的 visual studio,使其具有您正在使用的最新 SDK 版本。这应该可以解决错误,您在 Visual Studio 代码上 运行 的项目将有 the.VSCode 文件夹。
要更新 Visual Studio,请打开顶部菜单中的 Visual Studio 和 select 帮助,查找“检查更新”,然后进行更新。
如果您当时已经完成所有这些操作,简单的 Vs Code 重启可能就是答案。
这似乎已经为我完成了 代码 -> 首选项 -> 设置 -> 单击此
;/ 希望我至少有 10 个声望 post 这里的图片但是它是右上角的第一个图标看起来像一张小纸片。
然后..
将意大利面复制到 settings.json
{
"explorer.compactFolders": false,
"update.mode": "none",
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"omnisharp.path": "latest",
"omnisharp.monoPath": "auto",
"csharp.semanticHighlighting.enabled": true,
"editor.formatOnType": true,
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
"settingsSync.ignoredExtensions": [],
"window.zoomLevel": 0
}
那个^
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
但我认为这就是我的诀窍 ^ 特别是 [csharp]
通过查看启动日志,我看到一条消息说我需要 .NET Developer Pack 4.7.1。
从 https://docs.microsoft.com/de-de/dotnet/framework/install/guide-for-developers 下载并安装 .NET Framework 4.7.1(开发包)解决了我的问题。