【问题标题】:System.TypeLoadException when debugging C# code in Vscode在 Vscode 中调试 C# 代码时出现 System.TypeLoadException
【发布时间】:2019-10-07 08:36:25
【问题描述】:

当我安装 C# 扩展时,一切正常。但是后来我安装了 Mono(并出于某种原因将其卸载)并且扩展现在不起作用

我尝试再次卸载并安装 dotnet3,但这没有任何意义。

Starting OmniSharp server at 10/7/2019, 11:23:01 AM
    Target: /home/newusername77177/ProgrammingFolder/C#/Study

OmniSharp server started with Mono 6.4.0.
    Path: /home/newusername77177/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/OmniSharp.exe
    PID: 9152

System.TypeLoadException: Could not load type of field 'McMaster.Extensions.CommandLineUtils.CommandLineApplication:_validationErrorHandler' (36) due to: Could not load file or assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
  at OmniSharp.Stdio.StdioCommandLineApplication..ctor () [0x00000] in <33949cd60c2b4bc38b57918b6c0a9e6f>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00006] in <5930e76072f14255af7d67dbd8f6513a>:0 
  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <2cb0afb412134712add1d51352aad594>:0 
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

【问题讨论】:

    标签: c# debugging visual-studio-code mono


    【解决方案1】:

    尝试在 vscode 中设置 Omnisharp: Use Global Mono to never 而不是 auto。 为我工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-19
      • 2015-08-08
      • 1970-01-01
      • 2021-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-26
      相关资源
      最近更新 更多