API application could not connect to server. 


Error message from log file

...

Could not connect to SystemWeaver server!
SystemWeaver.ClientAPI.SWIOError: Error reading buffer: “Systemite.Lz4.Lz4” S

ystem.TypeInitializationException: “Systemite.Lz4.Lz4” 

System.IO.FileNotFoundException: Unable to load lz4 compression library

...

Resolution

Confirm that the server OS, the Visual C++ Redistributable for Visual Studio and the API application are all either 32 or 64 bit. A mismatch could be causing the problem. If the C++ Redistributable is missing, you will need to install it: 

Download Microsoft Visual C++ Redistributable for Visual Studio 2017


You may also need to have the vcruntime140.dll (also in the correct 32 or 64 bit version) in the same location.


When I try to run multiple calls from the API, the connection is unsuccessful. 


Error message from log file

"Multiple CallServerConnection avoided." 


Resolution

The SystemWeaver API doesn't support multi-threading for reading or writing. What this means, for example, is that if you use the GUI thread to login, it will use the GUI thread to execute events, and if you try to run something from another thread, these commands may be executed in parallel with events and you will possibly end up with invalid data in the cache.


One solution is to open up another connection to the server to execute long-running work. Even though the SWConnection object is a singleton, there is nothing that prevents you from creating a new connection:


SWConnection connection2 = new SWConnection();


Observe that if you open a second connection, it will be completely independent, with it's own cache. Also, login is a quite big operation, so you should only do this when you have a lot of work to do.