I use Z3 via NuGet package in my .NET Core 2.1 project and recently tried to update from version 4.5.0.1 to 4.8.1. Then I reverted back to 4.5.0.1 and got this exception at context creation:
using(var ctx = new Microsoft.Z3.Context())
{
}
System.DllNotFoundException: Unable to load DLL 'libz3.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I checked the following:
libz3.dll
and Microsoft.Z3.dll
are stored in %userprofile%\.nuget\packages\z3x64win\4.5.0.1\lib
,libz3.dll
and Microsoft.Z3.dll
to bin
directory of the project but the problem persists.Are there any other necessary steps to refer Z3?
Back in the days I remember having these problems with Z3 and often it worked by trying the following:
Re-download or get Z3 dll's so that you are hundred procent sure they match and that VS or your environment don't use cache.
Are you sure both libz3.dll and z3.exe is in your PATH?
There is now an official .NET Core Z3 NuGet package which should solve all your issues: https://www.nuget.org/packages/Microsoft.Z3.x64/
User contributions licensed under CC BY-SA 3.0