This documentation is archived and is not being maintained.

XmlResolver.ResolveUri Method

When overridden in a derived class, resolves the absolute URI from the base and relative URIs.

[Visual Basic]
Public Overridable Function ResolveUri( _
   ByVal baseUri As Uri, _
   ByVal relativeUri As String _
) As Uri
public virtual Uri ResolveUri(
 Uri baseUri,
 string relativeUri
public: virtual Uri* ResolveUri(
 Uri* baseUri,
 String* relativeUri
public function ResolveUri(
   baseUri : Uri,
 relativeUri : String
) : Uri;


The base URI used to resolve the relative URI
The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the baseUri value. If relative, it combines with the baseUri to make an absolute URI.

Return Value

A Uri representing the absolute URI or a null reference (Nothing in Visual Basic) if the relative URI can not be resolved.


Exception Type Condition
ArgumentException baseUri and relativeUri are a null reference (Nothing in Visual Basic)


The absolute URI may be used as the base URI for any subsequent requests for entities that are relative to this URI.

Notes to Inheritors:  This method has an inheritance demand. Full trust is required to override the ResolveUri method. See Inheritance Demands for more information.


See XmlUrlResolver.GetEntity for an example using this method.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlResolver Class | XmlResolver Members | System.Xml Namespace