【发布时间】:2014-09-29 19:06:52
【问题描述】:
我有以下 SharePoint 2013 列表事件接收器。当接收器在项目更新上运行时,它会引发错误。下面的错误来自 SharePoint ULS 日志。有没有人遇到过这个问题,和/或知道如何解决它?
代码:
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;
}
}
错误:
- UserCodeExecutionProxy 调用失败。 Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException:无法加载程序集组。用户程序集组提供程序在尝试为指定程序集组提供用户程序集时引发异常。 ---> Microsoft.SharePoint.SPException:无法完成此操作。请再试一次。 ---> System.Runtime.InteropServices.COMException:无法完成此操作。请再试一次。0x80004005
在 Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(字符串 bstrUrl,字符串 bstrWebRelativeUrl,布尔 bHonorLevel,字节 iLevel,OpenBinaryFlags grfob,字符串 bstrEtagNotMatch,对象 punkSPFileMgr,布尔 bHonorCustomIrm,IrmProtectionParams 文件IrmSettings,字符串和 pEtagNew,字符串和 pContentTagNew,SPFileInfo)
在 Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(字符串 bstrUrl,字符串 bstrWebRelativeUrl,布尔 bHonorLevel,字节 iLevel,OpenBinaryFlags grfob,字符串 bstrEtagNotMatch,对象 punkSPFileMgr,布尔 bHonorCustomIrm,IrmProtectionParams 文件IrmSettings,字符串和 pEtagNew,字符串和 pContentTagNew,SPFileInfo 和 pFilePro) --- 内部异常堆栈跟踪结束 ---
在 Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
在 Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(字符串 bstrUrl,字符串 bstrWebRelativeUrl,布尔 bHonorLevel,字节 iLevel,OpenBinaryFlags grfob,字符串 bstrEtagNotMatch,对象 punkSPFileMgr,布尔 bHonorCustomIrm,IrmProtectionParams 文件IrmSettings,字符串和 pEtagNew,字符串和 pContentTagNew,SPFileInfo 和 pFilePro)
在 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)
在 Microsoft.SharePoint.SPFile.OpenBinary(SPOpenBinaryOptions openOptions)
在 Microsoft.SharePoint.Administration.SPSolutionLanguagePack.GetSolutionInfoFromGallery(Guid siteId, Guid solutionId, String solutionHash, String& fileName, String& hash, Byte[]& fileBytes)
在 Microsoft.SharePoint.Administration.SPSolutionLanguagePack.CreateSolutionPackage(SPRequest request, Guid siteId, Guid solutionId, String solutionHash)
在 Microsoft.SharePoint.UserCode。 SPUserCodeLightweightSolutionAssemblyGroupProvider.GetAssembliesInGroup(Guid siteId, String assemblyGroupId)
在 Microsoft.SharePoint.UserCode.SPUserCodeAssemblyCacheManager.EnsureUserCodeAssemblyGroupIsCached(Guid siteId, SPUserCodeAssemblyGroupId userCodeAssemblyGroupId) --- 内部异常堆栈跟踪结束 --- 服务器堆栈跟踪:
在 Microsoft.SharePoint.UserCode.SPUserCodeAssemblyCacheManager.EnsureUserCodeAssemblyGroupIsCached(Guid siteId, SPUserCodeAssemblyGroupId userCodeAssemblyGroupId)
在 Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)
在 System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
在 System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) 异常重新抛出
在 [0]:
在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 类型)
在 Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinityBucketName, SPUserCodeExecutionContext executionContext)
在 Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(键入 userCodeWrapperType,SPSite 站点,SPUserCodeExecutionContext executionContext)
【问题讨论】:
标签: c# .net sharepoint sharepoint-2013