How to know if your code is running on the Windows Azure compute emulator

To understand whether the role instance is running in the Windows Azure compute emulator, you simply need to check this static variable:

RoleEnvironment.IsEmulated

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment.isemulated.aspx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: