Skip to content

"The hostname could not be parsed" when opening PowerPoint document containing URLs with illegal character #274

@ukalhapu

Description

@ukalhapu
 It is known issue and already reported to MS by community 
 https://social.msdn.microsoft.com/Forums/office/en-US/0094bee2-b891-46e2-b233-b4b4a7519583/exception-the-hostname-could-not-be-parsed-when-opening-word-document?forum=oxmlsdk

Issue: 
  Exception "The hostname could not be parsed" when opening PowerPoint document containing URLs with illegal character.
  Our customer has PowerPoint document with links to local files for e.g. file:///\\cws1.conti.de@SSL\DavWWWRoot\content\00012274\Projects\blank.xlsx
  The PowerPoint document functions as expected and links get opened fine.  
   Windchill Desktop Integration (DTI) has use case where we open document programmatically which fails with the exception: 

Invalid URI: The hostname could not be parsed.
  at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
  at MS.Internal.IO.Packaging.InternalRelationshipCollection.ProcessRelationshipAttributes(XmlCompatibilityReader reader)
  at MS.Internal.IO.Packaging.InternalRelationshipCollection.ParseRelationshipPart(PackagePart part)
  at MS.Internal.IO.Packaging.InternalRelationshipCollection..ctor(Package package, PackagePart part)
  at System.IO.Packaging.PackagePart.EnsureRelationships()
  at System.IO.Packaging.PackagePart.GetRelationshipsHelper(String filterString)
  at DocumentFormat.OpenXml.Packaging.OpenXmlPart.Load(OpenXmlPackage openXmlPackage, OpenXmlPart parent, Uri uriTarget, String id, Dictionary`2 loadedParts)
  at DocumentFormat.OpenXml.Packaging.OpenXmlPartContainer.LoadReferencedPartsAndRelationships(OpenXmlPackage openXmlPackage, OpenXmlPart sourcePart, PackageRelationshipCollection    
       relationshipCollection, Dictionary`2 loadedParts)
   at DocumentFormat.OpenXml.Packaging.OpenXmlPartContainer.LoadReferencedPartsAndRelationships(OpenXmlPackage openXmlPackage, OpenXmlPart sourcePart, PackageRelationshipCollection  
     relationshipCollection, Dictionary`2 loadedParts)
  at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Load()
  at DocumentFormat.OpenXml.Packaging.PresentationDocument.Open(String path, Boolean isEditable, OpenSettings openSettings)
  at ParametricTechnology.Windchill.Msoi.Core.PropertyHandler.DeleteCustomPropertiesOfPPTOpenXMLDoc(String[] PropertyNames)

PowerPoint accepts such URL and see no problem in it, but Microsoft see it as a critical mistake and such documents cannot be opened by Open XML SDK that fails with above exception.
The workaround to remove ‘@’ character from URL is not acceptable by the customer with the same reason that if it works in PowerPoint then why it doesn’t work programmatically.
When do we expect the fix from MS for this known issue ?

We reported the case with Microsoft : 117090816305831, and MS support asked to report it here.

From: Abhinav Tripathi (ABHITRI) [mailto:tripathi.abhinav@microsoft.com]
Sent: 20 October 2017 12:35 PM
To: Kalhapure, Uday ukalhapu@ptc.com
Cc: MSSolve Case Email casemail@microsoft.com
Subject: RE: [REG:117090816305831] Exception "The hostname could not be parsed"

Hello Uday,

Hope you are doing fine.

We internally reached out to the Escalation from Open XML SDK team and they have informed that Open XML SDK is open source project and not supported by Microsoft officially and is community driven.

They have requested you to please open an issue here (https://github.com/OfficeDev/Open-Xml-Sdk/issues ) and they will take it up from here as it is open source now.

Please let me know if you have any query for me.

Thanks,
Abhinav

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions