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:
- my app is compiled for x64 and I use z3x64win package,
- both
libz3.dll
andMicrosoft.Z3.dll
are stored in%userprofile%\.nuget\packages\z3x64win\4.5.0.1\lib
, - tried to add this path to the PATH environment variable as described here but it did not help,
- tried to manually save
libz3.dll
andMicrosoft.Z3.dll
tobin
directory of the project but the problem persists.
Are there any other necessary steps to refer Z3?