I've created a Full Trust Proxy to help out a sandbox feature that needs to deploy a lot of list view web parts on activation, because full trust has access to
SPLimitedWebPartManager and sandbox code does not.
Now I'm getting a
System.TypeLoadException for the
SPLimitedWebPartManager type when I try to execute my proxy:
Microsoft.SharePoint.UserCode.SPUserCodeSolutionProxiedException: Could not load type 'Microsoft.SharePoint.WebPartPages.SPLimitedWebPartManager' from assembly 'Microsoft.SharePoint, Version=15.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.
I can see that it's referencing version 15.900.0.0, and according to this other answer, 15.900.0.0 is the sandbox version of the SharePoint DLL, and I need to be referencing the full version, 18.104.22.168.
Also, similarly to that answer, I can see in my VS project that the reference in the project is to the 22.214.171.124 version, and my project properties show "Sandboxed Solution: False", so I am getting no compile-time errors.
How can I get my code to reference and load the correct full trust version of
Microsoft.SharePoint.dll at run time?