core icon indicating copy to clipboard operation
core copied to clipboard

Error for add project folder in vs code

Open VINITPANDEY opened this issue 7 years ago • 3 comments

OmniSharp server started with Mono 6.0.0. Path: /home/linux/.vscode/extensions/ms-vscode.csharp-1.21.1/.omnisharp/1.34.2/omnisharp/OmniSharp.exe PID: 5226

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 :0 at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.

b__0 () [0x00006] in :0 at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <150636dc45ea41d3a8efdf330bb7b52f>:0

VINITPANDEY avatar Aug 28 '19 06:08 VINITPANDEY

It's not clear if this is a .NET, Mono, or Omnisharp issue. Can you reproduce this using just the .NET command line utilities?

scalablecory avatar Oct 03 '19 16:10 scalablecory

Closing due to lack of response; please feel free to re-open if you're still having this issue and can provide more details.

scalablecory avatar Oct 14 '19 17:10 scalablecory

Update

I think I found a solution, apparently, I needed to install mono-devel. after installing that, Omnisharp works just fine, It did say, there is no msbuild installed and suggested to install it, though it found one standalone in the project directory and could run the debugger (I have no clue why ! or how dot net or omnisharp works). So I installed the msbuild package and everything looks to be working now. ! !

First

Hello, I am facing the same problem for DOTNET Core 3.1 in Linux Mint 19.3 with VSCode.

OmniSharp server started with Mono 6.4.0.
    Path: /home/siratim/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/OmniSharp.exe
    PID: 5483

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

I was following the instruction given in the Microsoft documentation

I tried with older C# extension from VS Code but had no luck. dotnet 3.1 is installed as you can see here from the dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   3.1.100
 Commit:    cd82f021f4

Runtime Environment:
 OS Name:     linuxmint
 OS Version:  19.3
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.100/

Host (useful for support):
  Version: 3.1.0
  Commit:  157910edee

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

Any idea how to resolve the issue !

Shorotshishir avatar Dec 30 '19 03:12 Shorotshishir