Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is is possible to use OpenXML in SandBox.

CODE:

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

The above class WordprocessingDocument is giveing error as

ERROR:

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

2 Answers

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
add comment

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: http://blog.johnnybouder.com/post/2012/03/25/OpenXML-in-the-Sandbox.aspx

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
add comment

Your Answer

 
discard

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.