aries-framework-dotnet
aries-framework-dotnet copied to clipboard
System.DllNotFoundException: 'Unable to load DLL 'indy' or one of its dependencies:
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:
- Open visual studio with Webagent.sln. Compiled successfully, run the agent under debug mode
- 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.
Desktop (please complete the following information):
- Windows 10
- .Net core 3.1
- libindy from Nuget
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'.
Steps :
- 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/
- unzip the archive.
- 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
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?
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:
- Copy all the libs into the project folder at the same level as your
appsettings.json
. - 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