RelationshipExists Method

Package.RelationshipExists Method

Determines whether a package-level relationship with a given ID is contained in the package.

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

public bool RelationshipExists (
	string id
public boolean RelationshipExists (
	String id
public function RelationshipExists (
	id : String
) : boolean
You cannot use methods in XAML.



The Id of the relationship to check for.

Return Value

true if a package-level relationship with the specified id is in the package; otherwise, false.

Exception typeCondition


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


id is not a valid XML identifier.


The package is not open (Dispose or Close has been called).


The package is write-only.

For additional information see the Open Packaging Conventions (OPC) specification available for download at

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

Community Additions

© 2016 Microsoft