This documentation is archived and is not being maintained.

PackageRelationship.TargetUri Property

Gets the URI of the target resource of the relationship.

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

public Uri TargetUri { get; }
You cannot set this property in XAML.

Property Value

Type: System.Uri
The URI of the target resource.

The TargetUri is specified in the call to the Package.CreateRelationship or PackagePart.CreateRelationship method that created the relationship. After the relationship is created the TargetUri cannot be changed.

When TargetMode is Internal, the TargetUri MUST be a relative reference. For a package-level relationship, the relative reference of the TargetUri is resolved relative to the pack URI of the source package that owns and contains the relationship. (Example source package pack URI: "pack://http:,,,files,datapak.package/".) For a part-level relationship, the TargetUri is resolved relative to the source part that owns the relationship (TargetUri is interpreted relative to SourceUri).

When TargetMode is External, the TargetUri can be either a relative reference or a fully qualified URI. If the TargetUri is a relative reference, the reference is interpreted as relative to the location of the Package that contains this relationship.

For more information about TargetUri see Section 1.3.3 "Relationship Markup" of the Open Packaging Conventions specification available for download at

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0