hyperledger-archives / aries-framework-dotnet

Aries Framework .NET for building multiplatform SSI services
https://wiki.hyperledger.org/display/aries
Apache License 2.0
84 stars 74 forks source link

System.DllNotFoundException: 'Unable to load DLL 'indy' or one of its dependencies: #151

Open thomas-tran opened 3 years ago

thomas-tran commented 3 years ago

Describe the bug Open visual studio with Webagent.sln. Compiled successfully, run the agent under debug mode DefaultProvisioningHostService.cs await _provisioningService.ProvisionAgentAsync(); throw exeception System.DllNotFoundException: 'Unable to load DLL 'indy' or one of its dependencies: A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Open visual studio with Webagent.sln. Compiled successfully, run the agent under debug mode
  2. Debug step by step DefaultProvisioningHostService.cs await _provisioningService.ProvisionAgentAsync(); throw exeception System.DllNotFoundException: 'Unable to load DLL 'indy' or one of its dependencies:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

isapi commented 3 years ago

I tried put the Indy-SDK DLL files into the BIN folder and get a new error:

An unhandled exception occurred while processing the request. FileNotFoundException: Could not find file 'E:\BlockChainTest\bin\Debug\netcoreapp3.1\Hyperledger.Aries.AspNetCore.xml'.

gaclaudiu commented 3 years ago

Steps :

  1. download libindy latest stable version of water stable version you need. Here is the latest version(at the time writing the comment) : https://repo.sovrin.org/windows/libindy/stable/1.9.0/
  2. unzip the archive.
  3. the lib folder path from the unarchived folder needs to be added to the windows PATH system variables

Also this steps are documented here : https://github.com/hyperledger/indy-sdk/#windows

dnaicker commented 2 years ago

i could not resolve this error after updating env paths pointing to libindy.dll in lib folder

is there a way to check whether env path for libindy.dll is valid in a different way, similar to how indy-cli operates?

i am able to use indy-cli globally as a it finds the env path.

is there a nuget package that one can contain the necessary files without pointing to system path?

vv-myst commented 2 years ago

I dunno if this problem has been resolved for others or not, but adding them to PATH environment variable didnt help me .

This is what i had to do to get the webapp running:

  1. Copy all the libs into the project folder at the same level as your appsettings.json.
  2. Add the following to your .csproj file
<ItemGroup>
    <EmbeddedResource Include="indy.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>

    <EmbeddedResource Include="indy.dll.lib">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>

    <EmbeddedResource Include="libeay32md.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>

    <EmbeddedResource Include="libsodium.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>

    <EmbeddedResource Include="libzmq.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>

    <EmbeddedResource Include="ssleay32md.dll">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </EmbeddedResource>
</ItemGroup>

This will copy the libs into the bin folder when the solution is built and therefore make them available for the application to start.

I do not know if this a good/bad way. But none of the other solutions really worked for me.

Cheers