Unhandled exception was thrown by the sandboxed code wrapper’s Execute method in the partial trust app domain: An unexpected error has occurred.

Let’s start from beginning:

  1. You build sandbox solution that consist of branding feature will provision masterpages to masterpage gallery and styles to style library. Easy
  2. You are deploying solution to the site. You activating solution, all fine, branding feature has been activated automatically.
  3. Some time later you are upgrading a solution because you fixed few issues.
  4. You are deactivating solution, uploading solution, then you click activate. You get: Exception from HRESULT: 0×81070966
  5. Solution seems to be activated even you got this nasty error.
  6. You go to site collection features and you realize that your branding feature is not activated.
  7. You try to activate it and you get: Unhandled exception was thrown by the sandboxed code wrapper’s Execute method in the partial trust app domain: An unexpected error has occurred.
  8. No errors in trace log

When this happens to you, check if your masterpage has not been checked out by someone else. That was true in my case, someone else was provisioning this package and because sandbox files are always checked out to the person deploying it, if one does not remember to publish them manually of through the script, you can get this nasty error.

 

 

Leave a Reply