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;
userCodeService.ProxyOperationTypes.Add(proxyOperationType);
userCodeService.Update();
}
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.