Check Roles instance running in Emulator?
Learn here how to check Roles instance running in Emulator.
In Build Windows Azure SDK 1.5 got announced. Windows Azure SDK 1.5 allows us to check whether Roles are running in emulator or not?
Static method IsEmulated returns Boolean value after checking whether Role instance is running in emulator or not.
Signature of IsEmulated is as below and it is part of the class RoleEnvironment
You can check running instance is in emulator or not as below,
bool isRunningInEmulator = RoleEnvironment.IsEmulated;
if (isRunningInEmulator)
Label1.Text = "Running in Emulator";
else
Label1.Text = "Hey you are on Cloud";
I hope this post was useful. Thanks for reading