We're developing a SharePoint webpart as a sandboxed solution in Visual Studio 2013 for SharePoint Online. We use an external dll library iTextSharp for reading and writing to PDF. We are having a problem when activating our solution.
Our error message is:
Error validating assembly
itextsharp.dll.
This solution references prohibited type System.Reflection.BindingFlags and cannot be used on this site collection.
You've answered this question yourself already:
You can't use the
System.Reflectionnamespace with SharePoint Online solutions (for the most part). The only allowed members fromSystem.Reflectionare:I recommend taking a look at Microsoft's documentation for developing SharePoint Online solutions (link) as there are quite a few namespaces previously available for SharePoint development that are now prohibited.
Here's what Microsoft has to say about this:
And here's the list of prohibited namespaces (see documentation for all exceptions):