내보내기(0) 인쇄
모두 확장

RoleEnvironment.Roles 속성

Gets the set of Role objects defined for the hosted service.

네임스페이스: Microsoft.WindowsAzure.ServiceRuntime
어셈블리: Microsoft.WindowsAzure.ServiceRuntime(microsoft.windowsazure.serviceruntime.dll)

‘사용 방법
Dim value As IDictionary(Of String, Role)

value = RoleEnvironment.Roles

public static IDictionary<string,Role> Roles { get; }
/** @property */
public static IDictionary<String,Role> get_Roles ()

public static function get Roles () : IDictionary<String,Role>

속성 값

A IDictionary that contains the Role objects that are defined for the hosted service.

Roles are defined in the ServiceDefinition.csdef file. For more information about defining roles for a hosted service, see Setting Up a Hosted Service for Windows Azure.

The following code example shows how to obtain the role instance IDs for defined roles:


foreach (var roleDefinition in RoleEnvironment.Roles) 
{ 
   foreach (var roleInstance in roleDefinition.Value.Instances) 
   { 
      Trace.WriteLine("Role instance ID: " + roleInstance.Id, "Information");
   }
}
note참고
At least one internal endpoint must be defined for a role to enable instances to be known at runtime. For more information about defining internal endpoints, see How to Define Internal Endpoints for a Role.


이 형식의 모든 public static(Shared, Visual Basic의 경우) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

개발 플랫폼

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 및 Windows 2000

대상 플랫폼

커뮤니티 추가 항목

표시:
© 2014 Microsoft