For Web applications, Windows Azure provides caching capabilities to provide high-speed access, scale, and high availability to application data. The
AppFabric
service "
AppFabricCachingService
" runs to accommodate the caching and session management infrastructure. The Cache cluster can be started using the powershell.
In order to validate that the service is up and running, the following test can be performed.
namespace AppFabricServiceTest
{
internal static class Program
{
private static void Main(string[] args)
{
IsServiceRunning();
}
private static bool IsServiceRunning()
{
bool status = false;
var sc = new System.ServiceProcess.ServiceController("AppFabricCachingService");
if (sc.Status == System.ServiceProcess.ServiceControllerStatus.Stopped)
status = false;
else
status = true;
return status;
}
}
}
You would need
System.ServiceProcess
assembly reference in your project to invoke
ServiceController
and check the status, i.e.,
ServiceControllerStatus
. This enumeration provides various members including
ContinuePending
,
Pause
,
PausePending
,
Running
,
StartPending
,
Stopped
and
StopPending
.