Troubleshooting
This page describes exceptions you may encounter while using NCache and the corresponding steps to resolve them.
Disabling BinaryFormatter Serialization And Deserialization
Message: BinaryFormatter serialization and deserialization are disabled within this application.
This error can occur in older applications that use BinaryFormatter. For current NCache applications, use JSON serialization rather than enabling BinaryFormatter. Binary Serialization is not supported in NCache 5.3.7 and later.
Workaround
- Configure JSON serialization for the cache and update any application-specific serialization code accordingly.
- For a legacy application, review Microsoft’s BinaryFormatter migration guide. Starting with .NET 9, the runtime implementation throws
PlatformNotSupportedException, and theEnableUnsafeBinaryFormatterSerializationswitch does not restore it.
No sigar-amd64-winnt.dll in java.library.path
If you haven't included the sigar-amd64-winnt.dll file for Windows or the sigar-amd64-winnt.so file for Linux in your class path, you will encounter this warning, and when this happens, you won't be able to monitor your counters (in Java).
Workaround
Include the sigar-amd64-winnt.dll file for Windows or the sigar-amd64-winnt.so file for Linux in your classpath.
Unable to Handle Custom Types with JSON Serialization
Message: Unable to serialize or deserialize the specified type using JSON serialization.
You may encounter this issue when your application uses JSON serialization and a specific object type requires custom serialization or deserialization logic. This can happen when the default JSON serialization behavior is not enough for your object model.
Workaround
Configure an external Newtonsoft JsonConverter for the required custom type. For details, see External Newtonsoft JsonConverter Support.