UriParser.Resolve(Uri, Uri, UriFormatException) Method

Definition

Called by Uri constructors and TryCreate to resolve a relative URI.

protected virtual string? Resolve (Uri baseUri, Uri? relativeUri, out UriFormatException? parsingError);
protected virtual string Resolve (Uri baseUri, Uri relativeUri, out UriFormatException parsingError);

Parameters

baseUri
Uri

A base URI.

relativeUri
Uri

A relative URI.

parsingError
UriFormatException

When this method returns, contains the errors that occurred during the resolve process, if any.

Returns

The string of the resolved relative Uri.

Exceptions

baseUri parameter is not an absolute Uri

-or-

baseUri parameter requires user-driven parsing.

Remarks

Uri constructors and Uri.TryCreate use Resolve to construct a URI from baseUri and relativeUri.

If a parsing error occurs, the returned string for the resolved relative Uri is null.

Applies to

제품 버전
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1