PortalUrl Constructor (Guid, 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> _
Protected Friend Sub New ( _
portalUrlId As Guid, _
name As String, _
defaultUrl As Uri _
)
'Usage
Dim portalUrlId As Guid
Dim name As String
Dim defaultUrl As Uri
Dim instance As New PortalUrl(portalUrlId, _
name, defaultUrl)
[ObsoleteAttribute]
protected internal PortalUrl(
Guid portalUrlId,
string name,
Uri defaultUrl
)
Parameters
- portalUrlId
Type: System.Guid
- name
Type: System.String
- defaultUrl
Type: System.Uri
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.