microsoft / microsoft/node-api-dotnet

Unable to resolve native runtime dlls

Open
#398 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.