question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.TypeLoadException on Linux (Linux Mint 19)

See original GitHub issue

Environment data

dotnet --info output:

SDK .NET Core (reflétant tous les global.json) :
 Version:   2.1.402
 Commit:    3599f217f4

Environnement d'exécution :
 OS Name:     linuxmint
 OS Version:  19
 OS Platform: Linux
 RID:         linuxmint.19-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.402/

Host (useful for support):
  Version: 2.1.4
  Commit:  85255dde3e

.NET Core SDKs installed:
  2.1.402 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

VS Code version: (I guess this is code --version?)

1.27.2
f46c4c469d6e6d8c46f268d1553c5dc4b475840f
x64

C# Extension version: 1.16.1

Steps to reproduce

  • Launch VSCode in an Unity project (using Unity)
  • Watch the console open and immediately crash the OmniSharp server

Expected behavior

I expect to have IntelliSense and everything that comes with the extension.

Actual behavior

As the server crashes, nothing is added to the standard VSCode.

Additional informations

Here is the full log, using trace logging level:

Starting OmniSharp server at 2018-9-16 21:40:01
    Target: /home/$USER/Sources/Unity/Space Shooter/Space Shooter.sln

OmniSharp server started with Mono 5.14.0.
    Path: /home/$USER/.vscode/extensions/ms-vscode.csharp-1.16.1/.omnisharp/1.32.5/omnisharp/OmniSharp.exe
    PID: 25648

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 <e2653a02ab1f423abb805f2353ec9507>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00006] in <9671bf457f144c419fb0cdee3ca10088>:0 
  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <48aa3fb56cea4bd5ab9bfdf1170dd033>:0 
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

I am using the latest Mono and .NET Core, and everything is up-to-date. I also tried reinstalling the .NET Core. I also tried moving the ~/.vscode folder to an other name and deleting the ~/.omnisharp folder too (as suggested in #2489). I tried looking into the other issues, but no solution worked for me.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
ostuchlikcommented, Jan 13, 2019

I experienced the same issue on Ubuntu 16.04. I had monoruntime package installed. For me, setting omnisharp.useGlobalMono to Never solved the issue.

5reactions
TimWillebrandscommented, May 28, 2019

For me installing the mono-complete package following this fixed the error for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linux Mint 19 Cinnamon Release Notes
Linux Mint 19 is a long term support release which will be supported until 2023. It comes with updated software and brings refinements...
Read more >
Linux Mint: Home
Linux Mint is an elegant, easy to use, up to date and comfortable desktop operating system.
Read more >
Linux Mint 19 "Tara"
Linux Mint is an elegant, easy to use, up to date and comfortable desktop operating system.
Read more >
How to upgrade to Linux Mint 19
Update your Linux Mint 18.3 system. Using the Update Manager, click on "Refresh" to refresh the APT cache and apply all updates. D2....
Read more >
Download Linux Mint 21.1
Linux Mint is an elegant, easy to use, up to date and comfortable desktop operating system.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found