Share via


PortalUrl Constructor (String, Uri)

NOTE: This API is now obsolete.

Obsolete.

Namespace:  Microsoft.SharePoint.Portal.Topology
Assembly:  Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Syntax

'Declaration
<ObsoleteAttribute> _
Public Sub New ( _
    name As String, _
    defaultUrl As Uri _
)
'Usage
Dim name As String
Dim defaultUrl As Uri

Dim instance As New PortalUrl(name, defaultUrl)
[ObsoleteAttribute]
public PortalUrl(
    string name,
    Uri defaultUrl
)

Parameters

Remarks

The PortalUrl constructor throws an InvalidOperationException exception when you try to create a portal URL with an existing URL name. The workaround is to use a try/catch block around any PortalUrl constructors.

Sample of code that this change will break:

    TopologyManager tm = new TopologyManager();
    url1 = new PortalUrl("http://widgets.microsoft.com", new Uri(“https://https://widgets.microsoft.com”));
    tm.PortalUrls.Add(url1);
    url2 = new PortalUrl("http://widgets.microsoft.com", new Uri("https://https://widgets.microsoft.com")); //This throws System.InvalidOperationException

Workaround

Use a try/catch block around any PortalUrl constructors.

See Also

Reference

PortalUrl Class

PortalUrl Members

PortalUrl Overload

Microsoft.SharePoint.Portal.Topology Namespace