8000 Visual Studio Code/OmniSharp on Ubuntu 18.04: DllNotFoundException · Issue #417 · dotnet/Nerdbank.GitVersioning · GitHub
[go: up one dir, main page]

Skip to content
Visual Studio Code/OmniSharp on Ubuntu 18.04: DllNotFoundException #417
@qmfrederik

Description

@qmfrederik

Visual Studio Code/OmniSharp fails to properly load .csproj projects which contain a reference to NerdBank.GitVersioning. I've tried with the latest version of the 3.0 series of nbgv, both from NuGet and the CI feed.

Don't have much time to deep dive into this at the moment. Here are a couple of things I've noticed:

  • Compiling using dotnet build works properly.
  • I'm a bit confused by the lib/ part in the path (lib/linux-x64/libgit2-572e4d8.so)
  • linux-x64/libgit2-572e4d8.so should load fine on my platform, see the ldd output below.

Here's the full stack error:

[fail]: OmniSharp.MSBuild.ProjectLoader
        The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly.
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux-x64/libgit2-572e4d8.so assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
  at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary () [0x00002] in <5eedf8e7a87843a29f618ebab30cacf5>:0 
  at LibGit2Sharp.Core.NativeMethods..cctor () [0x00045] in <5eedf8e7a87843a29f618ebab30cacf5>:0 
   --- End of inner exception stack trace ---
  at LibGit2Sharp.Core.Proxy.git_libgit2_opts_set_search_path (LibGit2Sharp.ConfigurationLevel level, System.String path) [0x00000] in <5eedf8e7a87843a29f618ebab30cacf5>:0 
  at LibGit2Sharp.GlobalSettings.SetConfigSearchPaths (LibGit2Sharp.ConfigurationLevel level, System.String[] paths) [0x0001a] in <5eedf8e7a87843a29f618ebab30cacf5>:0 
  at Nerdbank.GitVersioning.GitExtensions.OpenGitRepo (System.String pathUnderGitRepo, System.Boolean useDefaultConfigSearchPaths) [0x00025] in <e6b3f9410fa9409c8eeff285038f1773>:0 
  at Nerdbank.GitVersioning.VersionOracle.Create (System.String projectDirectory, System.String gitRepoDirectory, Nerdbank.GitVersioning.ICloudBuild cloudBuild, System.Nullable`1[T] overrideBuildNumberOffset, System.String projectPathRelativeToGitRepoRoot) [0x00017] in <e6b3f9410fa9409c8eeff285038f1773>:0 
  at Nerdbank.GitVersioning.Tasks.GetBuildVersion.ExecuteInner () [0x000c5] in <0c993f0ed37445e28de1993f9f821a67>:0 
  at MSBuildExtensionTask.ContextAwareTask.Execute () [0x0005e] in <0c993f0ed37445e28de1993f9f821a67>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 
  at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002a9] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 

Here's the ldd output:

$ 
62E5
ldd ~/.nuget/packages/nerdbank.gitversioning/3.0.41/build/runtimes/linux-x64/native/libgit2-572e4d8.so 
	linux-vdso.so.1 (0x00007fffb69b1000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7ee672a000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7ee650b000)
	libssl.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f7ee62a3000)
	libcrypto.so.1.0.0 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f7ee5e60000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7ee5a6f000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f7ee6c5d000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7ee586b000)

Leaving this here in case anyone else sees a similar problem (or even better, knows how to fix it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0