NCache 4.6 - Online Documentation

Start Cache Using API Calls

 
StartCache method in NCache enable the user to start an OutProc cache on the specified server. In case of failure, ManagementException is thrown by the cache. In this example, the user need to specify cache and server name to start a node.
 
      To utilize the API, include the following namespace in your application: Alachisoft.NCache.Web.Management. 
 
        //precondition: Cache has been registered but not initialized.
        string cacheName = "mycache";
        string serverName = "...."; // specify the server where cache is registered
 
        try
        {
            CacheManager.StartCache(cacheName, serverName);
        }
        catch (ManagementException ex)
        {
            //thrown if no cache exists or server name is invalid
        }
 
 
See Also