| Visual Basic (Declaration) | |
|---|---|
Public Function GetDefaultServiceKey() As ServiceKeyElement  | |
| Visual Basic (Usage) |  Copy Code | 
|---|---|
Dim instance As ObjectServerElement Dim value As ServiceKeyElement value = instance.GetDefaultServiceKey()  | |
| C# | |
|---|---|
public ServiceKeyElement GetDefaultServiceKey()  | |
| C++/CLI | |
|---|---|
public: ServiceKeyElement^ GetDefaultServiceKey();  | |
| Exception | Description | 
|---|---|
| System.InvalidOperationException | Thrown if a default key cannot be found | 
              The default key search is as follows:  1) if the RemoteBaseUrl and other properties on the ObjectServer are set then a ServiceKey is built from              this information and returned, 2) If a service key named "default" is found it will be returned; otherwise the first key in the collection is returned.              
            Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family