microsoft / microsoft/node-api-dotnet
Unable to resolve native runtime dlls
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 783
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
I use EFCore but it always throws DllNotFoundException, even I tried put .deps.json besides the dll I load.
System.DllNotFoundException: Unable to load DLL 'e_sqlite3' or one of its dependencies
The output directory of generator has a runtimes folder. But it seems not able to read the deps config.
Also, call to dotnet.System.Runtime.InteropServices.NativeLibrary.Load(library); cause directly crash, TryLoad will say IntPtr not exported. But if I create a wrapper call these api, it will work as expected.
So currently, I have to expose an API to LoadLibrary in advance. Hope this can provide a way to resolve native libraries like .deps.json does.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported NativeLibrary.Load and NativeLibrary.TryLoad calls, the generated runtimes folder, and the .deps.json behavior around e_sqlite3. Define how native libraries should be resolved in this process and verify that loading succeeds without requiring a separate LoadLibrary wrapper.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100