Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using in a Visual Studio extension #97

Closed
timheuer opened this issue Jul 20, 2023 · 2 comments
Closed

Using in a Visual Studio extension #97

timheuer opened this issue Jul 20, 2023 · 2 comments

Comments

@timheuer
Copy link

I'm trying to use this in a Visual Studio extension to work with GitHub.com secret storage (per their documentation, this is the library preferred).

Because this is a native wrapper, a few things are not happening...

  • The dependent package libsodium.dll are actually not being packaged into my extension
  • Even after manually copying the /runtimes folder from the dependent package, I believe I'm hitting DllNotFoundException in Initialize

I'm curious if you've faced this before ideally specifically in this use case, or perhaps another where the hosting model of the calling component might be different. Essentially I'm needing initialize to be directed where to do the DllLoad...

@ektrah
Copy link
Owner

ektrah commented Jul 21, 2023

The locations where the runtime looks for native libraries vary between the different versions of .NET Framework/.NET Core/.NET. There is an open issue since 2018 asking how to properly pack native libraries in NuGet packages. However, this doesn't seem to be a priority for Microsoft, so no one knows exactly what needs to be done, particularly for such obscure cases as Visual Studio extensions 🤷‍♂️

One thing you could try would be to add the 64-bit libsodium.dll directly as a project item to your Visual Studio extension and set "Build Action" to "Content" and "Copy To Output Directory" to "Copy always" or "Copy if newer".

@timheuer
Copy link
Author

Thanks @ektrah this is what I ended up exactly doing actually your suggestion and "it works on my machine" :-). I'm actually chatting with the NuGet folks (I work on the .NET team) about this scenario. VSIX also has a lot of weird things given how the app is hosted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants