I want to use C# interface to SWI-Prolog. so I add the SwiPlCs.dll to project references and set SWI_HOME_DIR environment variable but when i test my application with this sample in here,I get this error:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
And the output from debug show:
The thread 0x1bec has exited with code 259 (0x103).
'swicall.vshost.exe' (CLR v4.0.30319: swicall.vshost.exe): Loaded 'G:\testingpro\MYAPP\swicall\bin\Debug\swicall.exe'. Symbols loaded.
'swicall.vshost.exe' (CLR v4.0.30319: swicall.vshost.exe): Loaded 'G:\testingpro\MyAPP\swicall\bin\Debug\SwiPlCs.dll'. Cannot find or open the PDB file.
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
'swicall.vshost.exe' (CLR v4.0.30319: swicall.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
IF I copy swi-prolog dll files to my APP directly, the sample code works,but my codes faces with the 'Cannot find or open the PDB file 'message.
How to can I fix this error?
other information: OS:win8-64bit vs:2013-32bit SwiPlCs_1.1.60605.0 Swi-prolog ver7.3.8 Environment.SetEnvironmentVariable("SWI_HOME_DIR", @"C:\Program Files (x86)\swipl")
Copy Local
on swi-prolog assembly reference, it will force VS to copy referenced assembly tobin\Debug
directory. Cannot find PDB error - means that debugger cannot find.pdb
file associated with SWI-prolog DLL (usually named like dll but with.pdb
extension). PDB files are used be debuggers to locate and show source files e.g. on unhandled exception, in case when you are using external library you may ignore this error. – csharpfolkC:\Program Files (x86)\swipl\bin
to system%PATH%
, restart your computer (this is important), then it should work. Wrapper library was trying to loadlibswipl.dll
using WIN32LoadLibrary
but cannot find it, hence strange error message. – csharpfolk