The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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
public static Uri GetSourcePartUriFromRelationshipPartUri (
	Uri relationshipPartUri
public static function GetSourcePartUriFromRelationshipPartUri (
	relationshipPartUri : Uri
) : Uri
You cannot use methods in XAML.



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

Return Value

The SourceUri of the PackagePart from the relationship with the specified relationshipPartUri.

Exception typeCondition


relationshipPartUri is a null reference (Nothing in Visual Basic).


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 (invalid, 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" would return the SourceUri of "/files/document.xaml".

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0