[Mono-bugs] [Bug 570648] New: System.IO.Packaging ZipPackage does not work due to Uri issue

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 14 08:35:57 EST 2010



           Summary: System.IO.Packaging ZipPackage does not work due to
                    Uri issue
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: WPF
        AssignedTo: toshok at novell.com
        ReportedBy: amcgovern at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

There's an api in PackUriHelper to allow to relative Uris to be resolved into
one. See the remarks section at [0]. The issue is that the current
implementation of ResolvePartUri relies on a bug in mono which was fixed in
r132239. I'm unsure how to go about reimplementing this method, but until this
is fixed the Packaging API is completely unusable as this method is required
for the core funcionality to work.

Thinking about it, I think one possible approach would be to use an absolute
Uri as the base and contatenate that absolute uri with the sourcePartUri and
then concatenate the result of that with the targetUri and then trim out the
original absolute Uri. i.e.

public static Uri ResolvePartUri(Uri sourcePartUri, Uri targetUri)
    Uri uri = new Uri ("http://fake.com");
    uri = new Uri (uri, sourcePartUri);
    uri = new Uri (uri, targetUri);

    // Trim out 'http://fake.com'
    return new Uri (uri.OriginalString.SubString (15), UriKind.Relative); 

However there must be a better way than this.


Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list