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.

Error: Microsoft.AspNetCore.Razor.OmniSharpPlugin fails to load

See original GitHub issue

Issue Description

One day, the following error came to occur at startup. What is the cause?

System.TypeLoadException: VTable setup of type Microsoft.AspNetCore.Razor.OmniSharpPlugin.OmniSharpPluginStrongNamedRoslynServiceProvider failed
  at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,bool)
  at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.Boolean icase, System.RuntimeType reflectedType) [0x0001b] in <98fac219bd4e453693d76fda7bd96ab0>:0 
  at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <98fac219bd4e453693d76fda7bd96ab0>:0 
  at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <98fac219bd4e453693d76fda7bd96ab0>:0 
  at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00006] in <98fac219bd4e453693d76fda7bd96ab0>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at OmniSharp.CompositionHostBuilder.Build () [0x001ed] in <c228582629e34359bfdbc0fc855c1d2f>:0 
  at OmniSharp.Stdio.Host..ctor (System.IO.TextReader input, OmniSharp.Stdio.Services.ISharedTextWriter writer, OmniSharp.IOmniSharpEnvironment environment, Microsoft.Extensions.Configuration.IConfiguration configuration, System.IServiceProvider serviceProvider, OmniSharp.CompositionHostBuilder compositionHostBuilder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, System.Threading.CancellationTokenSource cancellationTokenSource) [0x0007e] in <19355510af164339b7bccd4ca09bc44c>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x00117] in <ba7fbbf8e8fb4043b79656a74082347f>:0 
  at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <c228582629e34359bfdbc0fc855c1d2f>:0 
  at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0 
  at OmniSharp.CommandLineApplication.Execute (System.Collections.Generic.IEnumerable`1[T] args) [0x00042] in <c228582629e34359bfdbc0fc855c1d2f>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <ba7fbbf8e8fb4043b79656a74082347f>:0 
  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <c228582629e34359bfdbc0fc855c1d2f>:0 
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

Environment information

VSCode version: 1.32.3 C# Extension: 1.19.0

Mono Information OmniSharp using global mono :5.16.0
Dotnet Information .NET Command Line Tools (2.1.2)

Product Information: Version: 2.1.2 Commit SHA-1 hash: 5695315371

Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.12-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.2/

Microsoft .NET Core Shared Framework Host

Version : 2.0.3 Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

Visual Studio Code Extensions
Extension Author Version
bracket-pair-colorizer CoenraadS 1.0.61
classynaming reflectiondm 1.2.0
code-spell-checker streetsidesoftware 1.7.1
csharp ms-vscode 1.19.0
dart-code Dart-Code 2.25.1
docomment k–kato 0.1.6
flutter Dart-Code 2.25.1
plantuml jebbs 2.10.9
unity-debug Unity 2.7.2
view-in-browser qinjia 0.0.5
vscode-language-pack-ja MS-CEINTL 1.33.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
filipwcommented, Apr 24, 2019

great! 👍👍

1reaction
ghkawacommented, Apr 24, 2019

It was set to "omnisharp.path": "1.32.3-beta.9", so delete it and solve the problem. Thank you for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load file or assembly 'netstandard, When Opening ...
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
Read more >
Omnisharp not working with Mono and Unity on Gentoo
ProjectManager Failed to load project file ... AspNetCore.Razor.OmniSharpPlugin.dll [info]: OmniSharp.Stdio.Host Starting OmniSharp on ...
Read more >
Fix OmniSharp error 'No default runtime found' in Visual ...
In Visual Studio code, you can install the C# language extension, which, in turn, will install OmniSharp. With the extension installed I was...
Read more >
Omnisharp with VS Code: Error, "Project Loading Failed"
The Problem Intellisense / Autocorrect is not working in Visual Studio Code. I believe this to be because the target framework can not...
Read more >
Fixing issues with building C# solutions in .NET Core using ...
NET Core project in VSCode, you might see a bug similar to the following: The SDK 'Microsoft.NET.Sdk' specified could not be found. To...
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