Search code examples
.netmonoopenxml-sdkopenxml

Can I use the Open XML SDK in Mono?


Can the Open XML SDK be used in Mono?


Solution

  • Edit: It seems to be working in the meantime: https://stackoverflow.com/a/28322467/743897

    Today (somewhere in 2011) I played around with the SDK and Mono 2.6.

    First I checked what MoMA thinks of the dll:

    4 different Methods in DocumentFormat.OpenXml.dll need the following method from Mono which is not available. At least according to MoMA.

    void XmlReaderSettings.set_MaxCharactersInDocument (Int64)
    

    But I was brave and tried to do stuff.

    The bad thing: It didn't really work well for me. I managed to create a very simple docx with the content "Hello World" and then load and read the file again. But as soon as I wanted to open user created and more complex documents stuff started to crash and break. There are some nasty Null Pointer Exceptions lurking around and sometimes the opened file even gets destroyed. Maybe because of the one missing method. It's a pity.

    Conclusion: At the moment the OpenXML SDK from Microsoft is not usable with Mono.