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.

Linux (Debian 10): System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

See original GitHub issue

Issue Description

When starting Visual Studio Code, the following message appears in the log: System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.

I’m using Debian 10, which I realize is not yet officially supported. If you feel like that might be the cause and don’t have the resources to investigate I understand.

Steps to Reproduce

Open a folder with a C# Solution in Visual Studio Code on an updated instance of Debian 10.

Expected Behavior

Omnisharp and thus Intellisense work.

Actual Behavior

Omnisharp server fails to start

Logs

OmniSharp log

Starting OmniSharp server at 9/6/2019, 8:49:43 PM Target: /home/lufix/src/emu/8080

OmniSharp server started with Mono 5.18.0. Path: /home/lufix/.vscode/extensions/ms-vscode.csharp-1.21.1/.omnisharp/1.34.2/omnisharp/OmniSharp.exe PID: 31312

System.IO.FileNotFoundException: Could not load file or assembly ‘netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. File name: ‘netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <150636dc45ea41d3a8efdf330bb7b52f>:0 at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0 at OmniSharp.CommandLineApplication.Execute (System.Collections.Generic.IEnumerable1[T] args) [0x00042] in <150636dc45ea41d3a8efdf330bb7b52f>:0 at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <ef67332970734dbbb15e5d0e9b13d144>:0 at OmniSharp.HostHelpers.Start (System.Func1[TResult] action) [0x0001c] in <150636dc45ea41d3a8efdf330bb7b52f>:0 [ERROR] Error: OmniSharp server load timed out. Use the ‘omnisharp.projectLoadTimeout’ setting to override the default delay (one minute).

C# log

(blank)

Environment information

VSCode version: 1.38.0 C# Extension: 1.21.1

Mono Information OmniSharp using global mono :5.18.0
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.401 Commit: 729b316c13

Runtime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/2.2.401/

Host (useful for support): Version: 2.2.6 Commit: 7dac9b1b51

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

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

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

Visual Studio Code Extensions
Extension Author Version
cpptools ms-vscode 0.25.1
csharp ms-vscode 1.21.1
Go ms-vscode 0.11.4
mssql ms-mssql 1.6.0
vetur octref 0.22.2
vscode-wasm dtsvet 1.2.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
doggutscommented, Sep 23, 2019

I have(/had) exactly the same issue, with pretty much the same setup (safe for the extensions).

Fix (option 1)

Change settings to:

 "omnisharp.useGlobalMono": "never"

Forces omnisharp to use the mono version packaged with omnisharp. Worked for me.

Fix (option 2)

Install the latest (stable) mono version from www.mono-project.com and keep

 "omnisharp.useGlobalMono": "always"

or

"omnisharp.useGlobalMono": "auto" 

Also verified working (for me).

Possible(?) cause

According to github.com/OmniSharp/omnisharp-roslyn :

If Mono is globally installed on the system, OmniSharp will prefer it over the embedded version, however version >=5.18.0 is required.

However; package.json states:

  • Automatically launch OmniSharp with “mono” if version 5.8.1 or greater is available on the PATH.",
  • Always launch OmniSharp with “mono”. If version 5.8.1 or greater is not available on the PATH, an error will be printed.",
  • Never launch OmniSharp on a globally-installed Mono."

Could be just an documentation inconsistency though. Or there’s something wrong with the debian 10 mono package(s), but I didn’t look any further into that.

Debian 10: (default) mono 5.18.0.240

Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-3 Wed Apr 17 16:37:36 UTC 2019) Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: supported, not enabled. Suspend: preemptive GC: sgen (concurrent by default)

C# extension 1.21.3 / omnisharp 1.34.4-beta.6: mono 5.18.1.0

Mono JIT compiler version 5.18.1.0 (tarball Fri Mar 15 20:45:47 UTC 2019) Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: yes(600) Suspend: preemptive GC: sgen (concurrent by default)

mono-project.com: mono 6.0.0.334

Mono JIT compiler version 6.0.0.334 (tarball Thu Sep 12 21:35:31 UTC 2019) Copyright © 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug Interpreter: yes LLVM: yes(600) Suspend: hybrid GC: sgen (concurrent by default)

3reactions
GabrielFerrarinicommented, Sep 24, 2019

@dogguts thank you. This worked also for Pengwin.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET Core: Could not load file or assembly 'System.Runtime ...
This seems very similar to Issue 150 and Issue 139 but I could not solve the problem by removing dependencies to my shared...
Read more >
c# - Could not load file or assembly 'System, Version=4.0.0.0 ...
I had this same problem - some users could pull from git and everything ran fine. Some would pull and get a very...
Read more >
System.Drawing.Common 7.0.0 - NuGet
Version Downloads Last updated 7.0.0 849,051 2 months ago 7.0.0‑rc.2.22472.3 52,124 2 months ago 7.0.0‑rc.1.22426.10 41,423 3 months ago
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