Export (0) Print
Expand All

PackUriHelper.GetSourcePartUriFromRelationshipPartUri Method

Returns the SourceUri from the PackageRelationship with a specified URI.

Namespace:  System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

public static Uri GetSourcePartUriFromRelationshipPartUri(
	Uri relationshipPartUri


Type: System.Uri

The URI of the relationship part to return the SourceUri from.

Return Value

Type: System.Uri
The SourceUri of the PackagePart from the relationship with the specified relationshipPartUri.


relationshipPartUri is null.


relationshipPartUri is an absolute URI.


relationshipPartUri syntax is not valid for a PackagePart.


relationshipPartUri does not reference a relationship part.


The SourceUri of the relationship part references another relationship part (not valid, see Remarks).

The SourceUri property of a relationship part must identify either the Package ("/") or a PackagePart that is not a PackageRelationship.

For example, if the package part "/files/document.xaml" is the source owner of the relationship part "/files/_rels/document.xaml.rels", calling GetSourcePartUriFromRelationshipPartUri with the relationshipPartUri parameter of "/files/_rels/document.xaml.rels" returns the SourceUri of "/files/document.xaml".

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft