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

In my sandboxed solution I have the following code that activates a proxy:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
            var type = typeof (ManagedLicenses.LicenseValidatorProxy);
            var proxyOperationType = new SPProxyOperationType(type.Assembly.FullName, type.FullName);
            var userCodeService = SPUserCodeService.Local;

Everything works fine on SharePoint 2010 - however I can't get it to work on SharePoint 2013 as I get the following exception thrown:

Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. - userCodeWrapperType = "Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper", userAssemblyGroupId = "1E58ADFF1BC14371BE7F7489551FBC5C-jfb9KwaIeEukOpyOxra2T8r/NE+fdQzldzg4bIF7Pfc=", siteCollectionId = "c4c2d6ab-8e79-491e-9d16-051a98696a4d" - Inner Exception: Microsoft.SharePoint.UserCode.SPUserCodeSolutionProxiedException: This code is calling a privileged proxy operation that is not available on this farm. Please contact your farm administrator.

I wonder if anybody else here had similar problems or knows a solution.

share|improve this question
Is this even supported in SharePoint 2013? "Sandbox Solutions changed their relationship status to 'it's complicated'". (That's the most accurate way I can describe the obsolete/deprecated status of SandBox solutions in 2013, nobody knows the truth yet). – James Love Jun 23 '13 at 20:46
I would love to get an answer to that question. – Rafał Saltarski Jun 24 '13 at 6:20

You cannot activate a Proxy in a Sandboxed solution, that would violate the security mechanism.

share|improve this answer
Hi Wictor, thanks for reading my question. I am not sure you understood it correctly though - my example is straight from msdn and I am confident the proxy serves exactly the purpose I am trying to use it for. – Rafał Saltarski Jul 16 '13 at 9:36

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.