【发布时间】:2014-08-14 16:04:12
【问题描述】:
我正在尝试将插件部署到本地 Dynamics CRM 2011。该插件不执行任何操作,它只是一个空的 Execute 方法,附加在 Account 实体的后处理事件上。
我的插件是这样的:
namespace CrmDemo.Plugins
{
public class PostAccountCreateDetail: IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
}
}
}
插件注册良好;这是注册屏幕的样子:
当我创建一个新帐户时,我收到以下错误:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetailDetail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail</Message>
<Timestamp>2014-08-14T15:29:09.9661308Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>
[CrmDemo.Plugins: CrmDemo.Plugins.PostAccountCreateDetail]
[3e3c27ae-c723-e411-bdf4-00155d1e0a3f: CrmDemo.Plugins.PostAccountCreateDetail: Create of account]
</TraceText>
</OrganizationServiceFault>
这是错误日志:
[2014-08-14 14:11:31.100] Process: w3wp |Organization:d39e4ccc-fc01-4c27-824d-9106d1ec082e |Thread: 22 |Category: Exception |User: 6abf3aac-971d-e411-aded-00155d1e0a3f |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | CrmException..ctor ilOffset = 0x7
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException) ilOffset = 0x7
at CrmException..ctor(String message, Exception innerException, Int32 errorCode) ilOffset = 0x5
at ExceptionConverter.TryConvertToCrmExceptionInternal(Exception exception, CrmException& crmException) ilOffset = 0x81
at ExceptionConverter.TryConvertToCrmException(Exception exception, CrmException& crmException) ilOffset = 0xAE
at SandboxCodeUnit.Execute(IExecutionContext context) ilOffset = 0x116
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0xE5
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1FB
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExtensiblePlatformMessageDispatcher.Execute(PipelineExecutionContext pluginContext) ilOffset = 0x0
at ExtensiblePlatformMessageDispatcher.CreateWithInvocationSource(BusinessEntity entity, Int32 invocationSource, ExecutionContext context) ilOffset = 0xB4
at BusinessProcessObject.Create(IBusinessEntity entity, ExecutionContext context) ilOffset = 0x4E
at AccountService.Create(IBusinessEntity entity, ExecutionContext context) ilOffset = 0xB
at RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) ilOffset = 0x25
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0x89
at LogicalMethodInfo.Invoke(Object target, Object[] values) ilOffset = 0x4F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x57
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0x50
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x156
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse) ilOffset = 0x145
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x3D
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x24
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xF6
at CreateCommand.Execute() ilOffset = 0xC
at EntityProxy.Create(Boolean performDuplicateCheck, Guid auditingTransactionId) ilOffset = 0x0
at EntityProxy.Create(Boolean performDuplicateCheck) ilOffset = 0x7
at AppForm.SaveEntity(EntityProxy entity, FormEventId eventType, String redirectPath, Boolean performDuplicateCheck) ilOffset = 0x28
at AppForm.FormSaveAndCloseEvent() ilOffset = 0x18
at AppForm.RaiseDataEvent(FormEventId eventId) ilOffset = 0xD7
at EndUserForm.Initialize(Entity entity) ilOffset = 0x1F
at CustomizableForm.Execute(Entity entity, FormDescriptor fd) ilOffset = 0x62
at AccountRecordPageHandler.ConfigureFormHandler() ilOffset = 0x56
at RecordPageHandler.ConfigureFormWrapper() ilOffset = 0xC
at GenericEventProcessor.RaiseEvent(String eventName) ilOffset = 0x2D
at PageManager.OnPreRender(EventArgs e) ilOffset = 0x47
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x6D3
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x33
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x18D
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0x10A
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x16A
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
>Crm Exception: Message: Assembly should be provided, ErrorCode: -2147204719
[2014-08-14 14:11:35.029] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 22 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | CrmException..ctor ilOffset = 0x7
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException) ilOffset = 0x7
at CrmException..ctor(String message, Exception innerException, Int32 errorCode) ilOffset = 0x5
at ExceptionConverter.TryConvertToCrmExceptionInternal(Exception exception, CrmException& crmException) ilOffset = 0x81
at ExceptionConverter.TryConvertToCrmException(Exception exception, CrmException& crmException) ilOffset = 0xAE
at SandboxCodeUnit.Execute(IExecutionContext context) ilOffset = 0x116
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0xE5
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1FB
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExtensiblePlatformMessageDispatcher.Execute(PipelineExecutionContext pluginContext) ilOffset = 0x0
at ExtensiblePlatformMessageDispatcher.CreateWithInvocationSource(BusinessEntity entity, Int32 invocationSource, ExecutionContext context) ilOffset = 0xB4
at BusinessProcessObject.Create(IBusinessEntity entity, ExecutionContext context) ilOffset = 0x4E
at AccountService.Create(IBusinessEntity entity, ExecutionContext context) ilOffset = 0xB
at RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) ilOffset = 0x25
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0x89
at LogicalMethodInfo.Invoke(Object target, Object[] values) ilOffset = 0x4F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x57
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0x50
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x156
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse) ilOffset = 0x145
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x3D
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x24
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xF6
at CreateCommand.Execute() ilOffset = 0xC
at EntityProxy.Create(Boolean performDuplicateCheck, Guid auditingTransactionId) ilOffset = 0x0
at EntityProxy.Create(Boolean performDuplicateCheck) ilOffset = 0x7
at AppForm.SaveEntity(EntityProxy entity, FormEventId eventType, String redirectPath, Boolean performDuplicateCheck) ilOffset = 0x28
at AppForm.FormSaveAndCloseEvent() ilOffset = 0x18
at AppForm.RaiseDataEvent(FormEventId eventId) ilOffset = 0xD7
at EndUserForm.Initialize(Entity entity) ilOffset = 0x1F
at CustomizableForm.Execute(Entity entity, FormDescriptor fd) ilOffset = 0x62
at AccountRecordPageHandler.ConfigureFormHandler() ilOffset = 0x56
at RecordPageHandler.ConfigureFormWrapper() ilOffset = 0xC
at GenericEventProcessor.RaiseEvent(String eventName) ilOffset = 0x2D
at PageManager.OnPreRender(EventArgs e) ilOffset = 0x47
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x6D3
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x33
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x18D
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0x10A
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x16A
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
>Crm Exception: Message: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail, ErrorCode: -2147220970
[2014-08-14 14:11:35.031] Process: w3wp |Organization:d39e4ccc-fc01-4c27-824d-9106d1ec082e |Thread: 22 |Category: Sandbox |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | SandboxCodeUnit.Execute ilOffset = 0x116
>Execute: CrmException: CrmDemo.Plugins, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a1e5ef8c26cb80d2; 80040216; System.ArgumentNullException: Value cannot be null.
>Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail
[2014-08-14 14:11:35.032] Process: w3wp |Organization:d39e4ccc-fc01-4c27-824d-9106d1ec082e |Thread: 22 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | MessageProcessor.Execute ilOffset = 0x1FB
>MessageProcessor fail to process message 'Create' for 'account'.
[2014-08-14 14:11:35.034] Process: w3wp |Organization:d39e4ccc-fc01-4c27-824d-9106d1ec082e |Thread: 22 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | MessageProcessor.Execute ilOffset = 0x1C5
>MessageProcessor fail to process message 'Create' for 'account'.
[2014-08-14 14:11:35.035] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 22 |Category: Exception |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | CrmException..ctor ilOffset = 0x7
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException) ilOffset = 0x7
at CrmException..ctor(String message, Int32 errorCode) ilOffset = 0x5
at PlatformCommand.CreateCrmExceptionFromServiceFault(FaultException`1 fe) ilOffset = 0x1B
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xF6
at CreateCommand.Execute() ilOffset = 0xC
at EntityProxy.Create(Boolean performDuplicateCheck, Guid auditingTransactionId) ilOffset = 0x0
at EntityProxy.Create(Boolean performDuplicateCheck) ilOffset = 0x7
at AppForm.SaveEntity(EntityProxy entity, FormEventId eventType, String redirectPath, Boolean performDuplicateCheck) ilOffset = 0x28
at AppForm.FormSaveAndCloseEvent() ilOffset = 0x18
at AppForm.RaiseDataEvent(FormEventId eventId) ilOffset = 0xD7
at EndUserForm.Initialize(Entity entity) ilOffset = 0x1F
at CustomizableForm.Execute(Entity entity, FormDescriptor fd) ilOffset = 0x62
at AccountRecordPageHandler.ConfigureFormHandler() ilOffset = 0x56
at RecordPageHandler.ConfigureFormWrapper() ilOffset = 0xC
at GenericEventProcessor.RaiseEvent(String eventName) ilOffset = 0x2D
at PageManager.OnPreRender(EventArgs e) ilOffset = 0x47
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x6D3
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x33
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x18D
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0x10A
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x16A
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
>Crm Exception: Message: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail, ErrorCode: -2147220970
[2014-08-14 14:11:35.037] Process: w3wp |Organization:d39e4ccc-fc01-4c27-824d-9106d1ec082e |Thread: 22 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5c0dd2c9-f20d-4ebb-b9ff-3b8698a15c4d | ErrorInformation.LogError ilOffset = 0x17
>MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail
Error Number: 0x80040216
Error Message: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail
Error Details: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail
Source File: Not available
Line Number: Not available
Request URL: http://localhost/MartinandAssociates/userdefined/edit.aspx?etc=1&pagemode=iframe
Stack Trace Info: [CrmException: System.ArgumentNullException: Value cannot be null.
Parameter name: The plug-in type could not be found in the plug-in assembly: CrmDemo.Plugins.PostAccountCreateDetail]
at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
at Microsoft.Crm.Application.Platform.ServiceCommands.CreateCommand.Execute()
at Microsoft.Crm.Application.Platform.EntityProxy.Create(Boolean performDuplicateCheck, Guid auditingTransactionId)
at Microsoft.Crm.Application.Platform.EntityProxy.Create(Boolean performDuplicateCheck)
at Microsoft.Crm.Application.Forms.AppForm.SaveEntity(EntityProxy entity, FormEventId eventType, String redirectPath, Boolean performDuplicateCheck)
在 DotPeek 中查看 CrmDemo.Plugins.dll 文件,我可以清楚地看到 PostAccountCreateDetail 类,所以我不知道为什么 CRM 说它找不到它。
【问题讨论】:
-
我认为那只是不幸的编辑它的意思是在插件程序集中找不到插件类型:CrmDemo.Plugins.PostAccountCreateDetail 详细信息: 看看第二个如何错误只是说:CrmDemo.Plugins.PostAccountCreateDetail 至于为什么你会得到这个错误很难说,跟踪日志中有什么吗?
-
我在原帖中添加了crm错误跟踪文件。
-
这是在沙盒模式下注册的吗?你试过在普通模式下注册吗?错误日志没有提供太多线索
-
这是在沙盒模式下注册并以数据库模式存储的。尝试在“无”模式下注册时,出现以下异常:无法加载插件类型:CrmDemo.Plugins.PostAccountCreateDetail
-
插件注册工具的截图看起来像CRM 2013版本。您确定您使用正确版本的 sdk 开发了您的插件吗?
标签: c# dynamics-crm-2011 dynamics-crm