Share via


IConnectionBuilder.BuildConnection Method

Definition

Creates a new connection.

Overloads

BuildConnection(IServiceProvider, ManagementScope)

Creates a new connection.

BuildConnection(IServiceProvider, ConnectionInfo, Exception)

Creates a new connection by using existing connection information.

BuildConnection(IServiceProvider, ManagementScope)

Creates a new connection.

public:
 Microsoft::Web::Management::Client::ConnectionInfo ^ BuildConnection(IServiceProvider ^ serviceProvider, Microsoft::Web::Management::Server::ManagementScope scope);
public Microsoft.Web.Management.Client.ConnectionInfo BuildConnection (IServiceProvider serviceProvider, Microsoft.Web.Management.Server.ManagementScope scope);
abstract member BuildConnection : IServiceProvider * Microsoft.Web.Management.Server.ManagementScope -> Microsoft.Web.Management.Client.ConnectionInfo
Public Function BuildConnection (serviceProvider As IServiceProvider, scope As ManagementScope) As ConnectionInfo

Parameters

serviceProvider
IServiceProvider

The IServiceProvider interface to connect to.

scope
ManagementScope

An enumeration value that represents an application, server, or site management unit.

Returns

A ConnectionInfo object that contains information about the connection.

Remarks

This method builds a connection with the System.IServiceProvider interface. This overloaded method is the same as calling the BuildConnection(IServiceProvider, ConnectionInfo, Exception) overload with the existingConnectionInfo parameter and connectionException parameter set to null.

The returned ConnectionInfo object is a logical representation of a connection and includes the credentials and scope for the connection. Use this method to log on to the user interface (UI) page.

Applies to

BuildConnection(IServiceProvider, ConnectionInfo, Exception)

Creates a new connection by using existing connection information.

public:
 Microsoft::Web::Management::Client::ConnectionInfo ^ BuildConnection(IServiceProvider ^ serviceProvider, Microsoft::Web::Management::Client::ConnectionInfo ^ existingConnectionInfo, Exception ^ connectionException);
public Microsoft.Web.Management.Client.ConnectionInfo BuildConnection (IServiceProvider serviceProvider, Microsoft.Web.Management.Client.ConnectionInfo existingConnectionInfo, Exception connectionException);
abstract member BuildConnection : IServiceProvider * Microsoft.Web.Management.Client.ConnectionInfo * Exception -> Microsoft.Web.Management.Client.ConnectionInfo
Public Function BuildConnection (serviceProvider As IServiceProvider, existingConnectionInfo As ConnectionInfo, connectionException As Exception) As ConnectionInfo

Parameters

serviceProvider
IServiceProvider

The IServiceProvider interface to connect to.

existingConnectionInfo
ConnectionInfo

The current connection object.

connectionException
Exception

An exception that occurred during a connection.

Returns

A ConnectionInfo object that contains information about the connection.

Remarks

This method builds a connection with the System.IServiceProvider interface by using the existingConnectionInfo parameter. The returned ConnectionInfo object is a logical representation of a connection and includes the credentials and scope for the connection. Use this method to log on to the current user interface (UI) page.

Applies to