Bug 1463 - System.IO.Packaging.ZipPackage generates [Content_Types.xml] using <Override> instead of <Default>
Summary: System.IO.Packaging.ZipPackage generates [Content_Types.xml] using <Override>...
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Alan McGovern
Depends on:
Reported: 2011-10-12 17:37 UTC by mariok
Modified: 2011-10-19 05:45 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Comment 1 Miguel de Icaza [MSFT] 2011-10-16 11:49:41 UTC
Alan, could you look at this patch for System.IO packaging?

We would want to get the fix in 2-10 and master.
Comment 2 Alan McGovern 2011-10-17 20:04:16 UTC
Do you have a testcase for where this breaks something? I'll have to read up on the docs to see when Default is used and when Override is used. At the moment we do unconditionally write 'override', but there must be some logic used to decide which one to use.
Comment 3 Alan McGovern 2011-10-17 20:10:42 UTC
Ok, so a quick test shows me that if i had three files with the same extension and three different content types, the extension+content type is used in a <Default> node to set the default content type for all files of that extension. Subsequent files which have the same extension and a different content type use the <override> node to explicitly set a new content type. We need to support this.
Comment 4 Alan McGovern 2011-10-17 20:12:15 UTC
Though i should also mention that what mono does *should* be fine, so if you have a testcase where a mono package with all <Override> elements fails, I'd love to have it.

Comment 5 Alan McGovern 2011-10-18 06:56:15 UTC
I've committed a fix for this so that we write out a <Default> tag the first time we see each file extension.  We already had full support for reading files which used both <Default> and <Override> nodes.  I'd still love to know why/how the existing method was failing for you though. If you can't remember or there's no simple test, it's fine. I'll just mark the bug as closed as the actual issue is gone now.
Comment 6 Alan McGovern 2011-10-19 05:45:37 UTC
Info was provided in an email, so we're all good now!