Saturday, April 23, 2011

Confusing error message from Sandboxed code

During the development of a Sandboxed workflow activity, I got error message below from ULS during the test.

Solution Deployment : Missing one or more of the following attributes from the root node in solution EFSBWFActivities.waitForUnlockWorkflowSB.wsp: assembly '', type ''.

At first I thought there was a typo in the elements.xml file or package file. But after comparing them with some other correct files, this possibility was excluded.  Then I spent quite a while googling, and occasionally noticed there was some code such as "SPSecurity.RunWithElevatedPrivileges()" in the activity! "RunWithElevatedPrivileges" is not supported by Sandboxed code. After removing it, everything goes well.

1 comment:

  1. What if you get this on a farm solution?
    All I read is that this error typically comes from sandboxed solutions, but I have a farm solution (which was never set to sandboxed either).

    I didn't touch any of the xml files, so if those are messed up, then it's because visual studio did so.

    ReplyDelete