dotnet/wpf · error · InvalidDataException
SR.ReachPackaging_MoreThanOneStartingParts
Error message
SR.ReachPackaging_MoreThanOneStartingParts
What it means
While resolving the FixedDocumentSequence (starting part), XpsManager iterates package relationships of type ReachPackageStartingPartRelationshipType. If more than one starting-part relationship exists, InvalidDataException(SR.ReachPackaging_MoreThanOneStartingParts) is thrown; an XPS package must designate exactly one starting part (FixedDocumentSequence).
Solutions
- Open the package and remove all but one relationship of type ReachPackageStartingPartRelationshipType from the root relationships.
- Re-save/normalize the package with a conformant producer (e.g. re-print or re-serialize it).
- Fix the writer code that creates the starting-part relationship to create it only once.
Defensive patterns
Strategy: try-catch
Try / catch
catch (InvalidDataException) { /* more than one starting-part relationship: normalize the package or reject it */ } Prevention
- Create the starting-part relationship exactly once per package.
- Validate package root relationships after generating XPS files.
- Avoid copying _rels/.rels entries when cloning packages.
When it happens
Trigger: Opening an XPS package that declares two or more root relationships with the starting-part relationship type — a spec-violating package produced by a buggy writer or manual package editing.
Common situations: Buggy third-party XPS generators; copying the FixedDocumentSequence relationship when cloning a package; hand-modifying the ZIP's _rels/.rels file.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- SR.ReachPackaging_MoreThanOneMetaDataParts
- Container already has Starting Part.
- Document has more than one Signature Definition…
- Document has more than one Thumbnail relationship.
- Package must contain an XPS PackagePart.
AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14).
Data as JSON: /api/errors/11b562e8ee9a5b84.
Report an issue: GitHub.
Appendix: source
Thrown at src/Microsoft.DotNet.Wpf/src/ReachFramework/Packaging/XpsManager.cs:1415
/// <returns>
/// PackagingPart instance of starting part.
/// </returns>
internal
static
PackagePart
GetXpsDocumentStartingPart(
Package package
)
{
Debug.Assert(package != null, "package cannot be null");
PackageRelationship startingPartRelationship = null;
PackagePart startingPart = null;
foreach (PackageRelationship rel in package.GetRelationshipsByType(XpsS0Markup.ReachPackageStartingPartRelationshipType))
{
if (startingPartRelationship != null)
{
throw new InvalidDataException(SR.ReachPackaging_MoreThanOneStartingParts);
}
startingPartRelationship = rel;
}
if (startingPartRelationship != null)
{
Uri startPartUri = PackUriHelper.ResolvePartUri(startingPartRelationship.SourceUri,
startingPartRelationship.TargetUri);
if (package.PartExists(startPartUri))
{
startingPart = package.GetPart(startPartUri);
}
}
return startingPart;
}View on GitHub (pinned to 81131a70a4)