The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator - InfoPath Dev
in

InfoPath Dev

The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator

Last post 08-21-2011 07:40 AM by Ramu55. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-08-2011 12:45 PM

    The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator

    Previously working IFS form now displays this error message when opening:

     The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator.

     -  - Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. - Monitored process "ipc://78303e5f-5df4-4d98-b04a-5b720bf6167f:7000" has encountered an unhandled exception while executing user code. - Inner Exception: Microsoft.SharePoint.UserCode.SPUserCodeSolutionProxiedException: Timeout while waiting for request to complete within the sandboxed appdomain.     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext) 


    FormServer Partial Trust - remote execution for solution 6fd1ce30-8245-4019-a82d-56b8b3d57bbc from site b0348e1d-9292-4126-8c06-643f580f2978 failed with exception Microsoft.SharePoint.UserCode.SPUserCodeSolutionExecutionFailedException: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. ---> Microsoft.SharePoint.UserCode.SPUserCodeSolutionProxiedException: Timeout while waiting for request to complete within the sandboxed appdomain.     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)     --- End of inner exception stack trace ---   

    Server stack trace:      at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeAppDomain.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessProxyForShim.ExecuteInternal(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcessProxy.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.ExecuteDelegate.EndInvoke(IAsyncResult result)     at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, SPUserToken userToken, String currentAffinity, SPUserCodeExecutionContext executionContext)  Microsoft.SharePoint.UserCode.SPUserCodePoolableProcessConnection.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)    Exception rethrown at [1]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type userCodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.PartialTrustExecutorHelper.<>c__DisplayClass1.<PlayEventLogInRemote>b__0(), inner exception Microsoft.SharePoint.UserCode.SPUserCodeSolutionProxiedException: Timeout while waiting for request to complete within the sandboxed appdomain.     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext).

    This is a sandbox solution deployment to a SharePoint 2010 Form Library.  I've attached the xsn.  Any help is appreciated.

  • 06-13-2011 11:21 AM In reply to

    Re: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator

     Have you spoken to a SharePoint admin? It sounds like a SharePoint issue; perhaps an admin turned off sandboxing.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 08-20-2011 07:28 AM In reply to

    • Ramu55
    • Not Ranked
    • Joined on 08-20-2011
    • Posts 2

    Re: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator

    did you find a solution for this?
  • 08-20-2011 09:59 AM In reply to

    Re: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator

    Hello Ramu55,

    even though I have not a "ready-to-run" solution for this problem I will try to help a little bit..

    This error occurs because of some code in a sandbox which is partially trusted is calling a dll in GAC which is having full trust. And the solution to this is, in the code which goes as dll in the gac inside it just decorate the namespace with the following line:

    [assembly: AllowPartiallyTrustedCallers]

    I don´t know if you use "code-behind" in your form but if you do you have to consider that you can´t use all of the objects in .Net framework. For instance (as I have heard) you can´t use SPSite or SPWeb object but this statement is with no guarantee as I´ve never tried it for myself. A complete list of limitations in a sandboxed solution will you find here:

    http://blogs.salmanghani.info/?p=310

    Hope that helps a little bit..

    Regards, 

    Karsten
    Filed under:
  • 08-21-2011 07:40 AM In reply to

    • Ramu55
    • Not Ranked
    • Joined on 08-20-2011
    • Posts 2

    Re: The custom code in the form cannot be run. This functionality may be deactivated on the server. For more information, contact the server farm administrator

     Hello Karsten,

    Thank you for your response.

    I do have code behind, and all of the assemblies I have have been tagged for allowing partially trusted callers.

    I tried publishing my forms on otther vms/environments and it worked, finally after doing some more log reading and reading on technet I was able to get it working by upgrading the timeout value of the user code service.

    SPUserCodeService.Local.WorkerProcessExecutionTimeout = 40; //default is 30 seconds

    It depends on the performance of the particular environment, hence on a multi-server farm I was not getting this error, while on vm it was failing. 

    Check this MSDN article http://msdn.microsoft.com/en-us/library/gg615462.aspx. though generally one should consider consulting the sharepoint admins before changing any of these values on production environment.

    thanks and regards

    Ramu

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.