NCache 4.4 - Online Documentation

Registering Non-Generic Classes

 
You can use either of the two ways described below to register your generic classes for compact serialization.
 
Using NCache Manager
 
  • Click on the cache name in Cache Explorer to open cache settings
  • Go to the Compact Serialization tab.
 
 
  • Click Add Types button. A new Select Compact Classes dialogue box will open up.
 
 
  • Click on Browse button. It will open a windows Open dialog. Using this dialog you can select .exe, .dll or .jar file.
  • Select your required file (.exe, .dll or .jar) and click on Open. It lists classes from the selected assembly in Loaded Class list box. Select desired classes which you want to register with NCache for compact serialization and click Add Class.
 
 
  • Compact Serialization works on attribute level. In the lower pane, attributes of all your selected classes get listed; from
  here you can select attributes which you do not want to be compact serialized.
 
 
  • Click OK to add classes. It lists fully qualified names of all selected classes in Compact Serialization tab.
 
 
  • Right click the cache in Cache Explorer and select Apply Configuration option.
 
 
 
Using Command Line Tool
 
  • Open command prompt
  • Go to the NCache tools directory: cd %NCHOME%/bin/tools
  • Use addcompacttype.exe, provide the required information: 
addcompacttype.exe /id demoLocalCache /a C:\Data.dll /c NCache.Sample.Data.Compact.Engineer
 
addcompacttype.exe /id demoLocalCache /a C:\Data.dll /c NCache.Sample.Data.Compact.Manager /al hireDate
  • Hit ENTER key, it defines a compact type for demoLocalCache. You can define further types one by one repeating the step
  for other types.
 
See Also