Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Invalid URI: The hostname could not be parsed.

Invalid URI: The hostname could not be parsed.

New Discussion
Radu Cristache
Radu Cristache asked on Jul 26, 2021 9:46 AM

Hello,

In the company I work for, we are using Infragistics Documents Excel module to parse a stream from the database representing an Excel file. The file contains @ signs in it, that excel considers to be mailto: hyperlink by default. When this happens, the infragistics Workbook.Load(stream) method throws an error with Invalid URI: The hostname could not be parsed. due to not being able to parse the mailto hyperlink.

Is there a way to fix or bypass this issue, it’s causing problems when large volumes of files are being processed and the support team has to go though the files and remove the hyperlinks.

I am using Infragistics4.Documents.Excel.v12.2, with .NET Framework 4.5.2 on Windows. The full error is this :

at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString, 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 Infragistics.Documents.Excel.PackagePartWrapper.GetRelationships()
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPart(IPackagePart part)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPartRelationships(IEnumerable`1 relationships, ContentTypeBase contentType, Boolean isPostLoad)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPart(IPackagePart part)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadPartRelationships(IEnumerable`1 relationships, ContentTypeBase contentType, Boolean isPostLoad)
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.LoadWorkbookContents()
at Infragistics.Documents.Excel.Serialization.WorkbookSerializationManager.Load()
at Infragistics.Documents.Excel.Workbook.LoadXLSXFile(Workbook workbook, Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
at Infragistics.Documents.Excel.Workbook.LoadHelper(Stream stream, WorkbookFormat format, String parameterName, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
at Infragistics.Documents.Excel.Workbook.Load(Stream stream, IPackageFactory packageFactory, Boolean verifyExcel2007Xml)
at Infragistics.Documents.Excel.Workbook.Load(Stream stream, Boolean verifyExcel2007Xml)

Any help would be appreciated.

Thank you,

Radu

Sign In to post a reply

Replies

  • 0
    Michael DiFilippo
    Michael DiFilippo answered on Jul 21, 2021 8:03 PM

    Hello Radu, 

    Please attach the Excel file so I can reproduce this. Theoretically I should be able to use the Load method on the file directly and it should exhibit the same behavior. If the issue does not nor can you reproduce the issue loading the file directly, please attach a sample that reproduces the behavior.

    • 0
      Radu Cristache
      Radu Cristache answered on Jul 22, 2021 8:08 AM

      Hello Michael,

      Thank you for your quick reply. Unfortunately the actual excel file contains some sensitive information, but I created a new file with just one cell where I added text very similar to what the cells in the actual file contain and I managed to reproduce it. Our API takes such a string and parses it to obtain certain info out of it. It reproduces even if you load the file directly(by path), even though we load it as a stream.

      Have a great day,

      Radu

      • 0
        Michael DiFilippo
        Michael DiFilippo answered on Jul 22, 2021 5:31 PM

        I put together a sample that loads your excel file without error in the most recent version 21.1. Please retest and let me know if you have any questions. 

        https://filetransfer.infragistics.com/public.php?service=files&t=47cfc83a6b89c1bf13da5043e39b3344 

      • 0
        Radu Cristache
        Radu Cristache answered on Jul 26, 2021 9:46 AM

        Hello,

        I managed to test as well using 21.1 and indeed the problem seems to be fixed there. I will have to see how to upgrade everything to this version. 

        Thanks a lot for the help.

        Have a great day,

        Radu

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Radu Cristache
Favorites
0
Replies
4
Created On
Jul 26, 2021
Last Post
4 years, 8 months ago

Suggested Discussions

Created by

Created on

Jul 26, 2021 9:46 AM

Last activity on

Feb 25, 2026 9:34 AM