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.ComparePackUri Method

Returns a value that indicates whether two pack URIs are equivalent.

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

public static int ComparePackUri (
	Uri firstPackUri,
	Uri secondPackUri
public static int ComparePackUri (
	Uri firstPackUri, 
	Uri secondPackUri
public static function ComparePackUri (
	firstPackUri : Uri, 
	secondPackUri : Uri
) : int
You cannot use methods in XAML.



The first pack URI.


The second pack URI.

Return Value

A signed integer indicating the relationship between firstPackUri and secondPackUri.



Less than zero

firstPackUri is less than secondPackUri.


firstPackUri is equivalent to secondPackUri.

Greater than zero

firstPackUri is greater than secondPackUri.

Exception typeCondition


Either firstPackUri or secondPackUri is not an absolute URI.


Either firstPackUri or secondPackUri do not begin with a "pack://" scheme.

If both firstPackUri and secondPackUri are a null reference (Nothing in Visual Basic), ComparePackUri returns zero (0). When comparing pack URIs, a a null reference (Nothing in Visual Basic) URI is always less than a non-a null reference (Nothing in Visual Basic) URI. For cases where firstPackUri and secondPackUri are both absolute pack URIs, ComparePackUri performs the comparison.

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