This documentation is archived and is not being maintained.

PackagePart Constructor (Package, Uri)

Initializes a new instance of the PackagePart class with a specified parent Package and part URI.

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

protected PackagePart(
	Package package,
	Uri partUri


Type: System.IO.Packaging.Package
The parent Package of the part.
Type: System.Uri
The URI of the part, relative to the parent Package root.


package or partUri is null.

partUri must be valid PackagePart URI formed in accordance with the RFC 3986 Uniform Resource Identifier (URI) Generic Syntax specification and the Open Packaging Conventions specification.

Use this constructor when the ContentType of the part is not immediately known and will be set later when CreatePart is called.

By default, the CompressionOption property of the part is initialized to NotCompressed.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

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