Monday, January 24, 2011

SharePont 2010: [ArgumentException: This code is calling a privileged proxy operation that is not available on this farm. Please contact your farm administrator.]

I have been struggling to get past this error when I deploy Full trust Sandbox Solution Proxy into the Farm. Few months ago I worked on Sandbox solutions fair amount of time but never got this error.

About the error: A Sandboxed solution is trying to a make a call to a Full trust Proxy Code and the method is not available somehow to the Sandboxed solution.

After making to sure all the DLLs, class names, assembly names, method names, including the registered ProxyServiceTypes, I had a doubt that something is case sensitive and hence the method is not available nor visible. After microscoping various things, here is what I found.

When calling the Proxy method, I used
SPUtility.ExecuteRegisteredProxyOperation("test.proxy, Version=2.0.0.0, Culture=Neutral, PublicKeyToken=1c97b34f7fd4d13d", "test.proxy.MethodName", new test.proxy.FileArgs(Arguments)).ToString();

First before getting this error, I used the signature using Reflector and copied the assembly info here. At that time Sandbox solution registration was not correct and hence it did not work. When all these got resolved and  after a few trial and error typos, Culture attribute of the AssemblyName was put case above. But when using .NET Refector I would get Culture=neutral.

For some reason I thought it was only the signature that mattered but it appeared that it is case sensitive too. It is my ignorance to know this before.

No comments:

Post a Comment