Bug 20754 - System.IO.Packaging, invalid time format in PackagePropertiesPart.cs when using OpenXML SDK 2.5
Summary: System.IO.Packaging, invalid time format in PackagePropertiesPart.cs when usi...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WindowsBase (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-06-20 09:57 UTC by Daniel Münch
Modified: 2014-06-20 09:58 UTC (History)
1 user (show)

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


Attachments
Proposed patch (2.76 KB, patch)
2014-06-20 09:58 UTC, Daniel Münch
Details | Diff

Description Daniel Münch 2014-06-20 09:57:58 UTC
The last two days or so I tried to use the OpenXML SDK in it's latest version to manipulate some Word files. I started developping on Visual Studio and everything worked fine, but since it's going to be a component used on a Linux Server I regulary tested on mono to see if things are compatible. (Googling for OpenXML and mono gives rather discouraging results so I preferred trying on my own.)

While Visual Studio created valid .docx files, the same code on mono (git main branch as of 17 june) would create files which Word refuses with a warning. Since Word is capable of recovering the "corrupted" file I figured that the problem might only be a small detail. Comparing the two files with the OpenXML SDK Productivity tool merely showed differences in /docProps/core.xml. After some fiddling around it was evident that the date format caused problems.

I digged into mono and indeed found the concerned part in  mcs/class/WindowsBase/System.IO.Packaging/PackagePropertiesPart.cs. I came up with a quick fix, which I'd like to share with you. Any chances this might go into the official distribution?
Comment 1 Daniel Münch 2014-06-20 09:58:29 UTC
Created attachment 7130 [details]
Proposed patch

Note You need to log in before you can comment on or make changes to this bug.