SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is is possible to use OpenXML in SandBox.


WordprocessingDocument myDoc = WordprocessingDocument.Open(mem, true); 

The above class WordprocessingDocument is giveing error as


The type 'System.IO.Packaging.Package' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
share|improve this question

No, this is not possible in the SharePoint Sandbox. You can't reference other DLL's and if you used the OpenXml source code you would still get problems since it uses namespaces in .Net which are not allowed in the Sandbox.

share|improve this answer

Contrary to my original comments, I have verified that this does not work in Office 365, however it does work in On Premise SharePoint 2010 Sandbox. Anyone interested in doing this in SharePoint 2010 sandbox can take a look at my post here:

share|improve this answer
In your case you've already installed the OpenXML binaries on the server, so it's not a fully sandboxed solution, right!? – Wictor Wilen MCA MCM MVP Mar 29 '12 at 12:34
Also this q is tagged with SharePoint Online - you can't do any installs there :) – Wictor Wilen MCA MCM MVP Mar 29 '12 at 12:50
Nope, I didn't install the binaries on the server. They are technically on my development laptop, but it has not been installed on the destination environments servers. That's why I'm including the binaries in the WSP so they are local to the sandbox solution. – user7796 Apr 10 '12 at 13:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.