HDFGroup / HDFGroup/HDF.PInvoke

Dotnet core fails loading native dlls

Open
#130 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
87
Forks
31
PR merge metrics
No merged PRs in 30d

Description

When running a dotnet core 2.0 unit test that uses a netstandard 2.0 package that uses HDF.PInvoke, it fails with the following exception:
```
System.TypeInitializationException: The type initializer for 'HDF.PInvoke.H5F' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'hdf5.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
```

HDF.PInvoke adds this to my PATH variable before loading the native dlls:
C:\Users\XXX\.nuget\packages\hdf.pinvoke\1.10.1\lib\bin64

However, the actual binaries are located in:
C:\Users\nohabie\.nuget\packages\hdf.pinvoke\1.10.1\build\bin64

Copying the native dlls to the build of the test "solves" the problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the HDF.PInvoke NuGet package paths shown in the report, especially lib\bin64 and build\bin64, and reproduce the failure with a .NET Core 2.0 unit test using the netstandard 2.0 package. Done means the test loads hdf5.dll from the package without copying native DLLs into the test build.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.