I have the following SharePoint 2013 list event receiver. When the receiver runs on item updating it throws a error. The error below is from the SharePoint ULS logs. Has anyone encountered this before, and/or know how to resolve it?
Code:
public override void ItemUpdating(SPItemEventProperties properties)
{
try
{
base.ItemUpdating(properties);
properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = "You cannot updated a approved requisition";
}
catch (Exception ex)
{
properties.Status = SPEventReceiverStatus.CancelWithError;
properties.ErrorMessage = ex.Message.ToString() + " Stack Trace -"
+ ex.StackTrace + "Inner Exception -" + ex.InnerException;
}
}
Error:
- UserCodeExecutionProxy call failed. Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException: Unable to load assembly group. The user assembly group provider threw an exception while trying to provide user assemblies for the specified assembly group. ---> Microsoft.SharePoint.SPException: Cannot complete this action. Please try again. ---> System.Runtime.InteropServices.COMException: Cannot complete this action. Please try again.0x80004005
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps)
at Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps) --- End of inner exception stack trace ---
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps)
at Microsoft.SharePoint.SPFile.GetFileStream(SPWeb web, String fileUrl, Boolean honorLevel, SPFileLevel level, OpenBinaryFlags openOptions, String etagNotMatch, SPFileStreamManager spMgr, SPFileRightsManagementSettings rightsManagementSettings, String& etagNew, String& contentTagNew, SPFileInfo& fileprops)
at Microsoft.SharePoint.SPFile.OpenBinary(SPOpenBinaryOptions openOptions)
at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.GetSolutionInfoFromGallery(Guid siteId, Guid solutionId, String solutionHash, String& fileName, String& hash, Byte[]& fileBytes)
at Microsoft.SharePoint.Administration.SPSolutionLanguagePack.CreateSolutionPackage(SPRequest request, Guid siteId, Guid solutionId, String solutionHash)
at Microsoft.SharePoint.UserCode. SPUserCodeLightweightSolutionAssemblyGroupProvider.GetAssembliesInGroup(Guid siteId, String assemblyGroupId)
at Microsoft.SharePoint.UserCode.SPUserCodeAssemblyCacheManager.EnsureUserCodeAssemblyGroupIsCached(Guid siteId, SPUserCodeAssemblyGroupId userCodeAssemblyGroupId) --- End of inner exception stack trace --- Server stack trace:
at Microsoft.SharePoint.UserCode.SPUserCodeAssemblyCacheManager.EnsureUserCodeAssemblyGroupIsCached(Guid siteId, SPUserCodeAssemblyGroupId userCodeAssemblyGroupId)
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, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) 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.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)