CRM 2016在线 - 调试自定义工作流活动崩溃插件注册工具

时间:2017-06-21 08:38:33

标签: workflow dynamics-crm-online

我想使用插件注册工具(从现在开始引用为PRT)来调试CRM 2016在线的自定义工作流活动。我的问题是每当我点击" Profile Workflow"按钮,PRT崩溃。

有关崩溃的详细信息可在事件日志中找到,并在下面说明。

事件日志条目一:

  

错误应用程序名称:PluginRegistration.exe,版本:8.2.1.8676,时间戳:0x58d073d5       错误模块名称:KERNELBASE.dll,版本:10.0.15063.296,时间戳:0xa0527b0c       异常代码:0xe0434352       故障偏移:0x0000000000069e08       错误进程id:0xb70       错误应用程序启动时间:0x01d2ea6794b7727a       错误的应用程序路径:D:_temp \ SDK \ Tools \ PluginRegistration \ PluginRegistration.exe       错误模块路径:C:\ WINDOWS \ System32 \ KERNELBASE.dll       报告ID:21f5bf85-22be-44ca-b884-ef43d9490886       错误包全名:       错误的包相关应用程序ID:

事件日志条目二:

  

应用程序:PluginRegistration.exe       框架版本:v4.0.30319       描述:由于未处理的异常,进程终止。       异常信息:System.Xml.XPath.XPathException          在MS.Internal.Xml.XPath.XPathParser.CheckToken(LexKind)          在MS.Internal.Xml.XPath.XPathParser.ParsePredicate(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseStep(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseAdditiveExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseExpresion(MS.Internal.Xml.XPath.AstNode)          在MS.Internal.Xml.XPath.XPathParser.ParseXPathExpresion(System.String)          在System.Xml.XPath.XPathExpression.Compile(System.String,System.Xml.IXmlNamespaceResolver)          在System.Xml.XPath.XPathNavigator.Compile(System.String)          在System.Xml.XmlNode.SelectSingleNode(System.String,System.Xml.XmlNamespaceManager)          在PluginProfiler.Library.WorkflowXamlUtility.GetCustomActivityFullyQualifiedName(System.String,System.Xml.XmlNode,System.Xml.XmlNamespaceManager)          在PluginProfiler.Library.WorkflowXamlUtility.GetCustomActivityFullyQualifiedNames(Microsoft.Xrm.Tooling.Connector.CrmServiceClient,System.Xml.XmlDocument,System.Xml.XmlNamespaceManager)          在PluginProfiler.Library.WorkflowXamlUtility.GetWorkflowActivitySteps(Microsoft.Xrm.Tooling.Connector.CrmServiceClient,System.String)          在Microsoft.Crm.Tools.PluginRegistration.CommonControls.ExistingWorkflow.Refresh()          在Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.set_SelectedWorkFlow(Microsoft.Crm.Tools.PluginRegistration.CommonControls.ExistingWorkflow)          在Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.RefreshWorkflows()          在Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel..ctor(Microsoft.Crm.Tools.Libraries.CrmOrganization,PluginProfiler.OperationType,System.Guid,Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsView)          在Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.StartProfiler_Clicked()          在Microsoft.Crm.Tools.PluginRegistration.OrganizationControlViewModel.MenuItem_Clicked(System.Object)          在MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource,Boolean)          在System.Windows.Controls.MenuItem.InvokeClickAfterRender(System.Object)          在System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32)          在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)          在System.Windows.Threading.DispatcherOperation.InvokeImpl()          在System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean)          在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean)          在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object)          在MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext,System.Threading.ContextCallback,System.Object)          在System.Windows.Threading.DispatcherOperation.Invoke()          在System.Windows.Threading.Dispatcher.ProcessQueue()          在System.Windows.Threading.Dispatcher.WndProcHook(IntPtr,Int32,IntPtr,IntPtr,Boolean ByRef)          在MS.Win32.HwndWrapper.WndProc(IntPtr,Int32,IntPtr,IntPtr,Boolean ByRef)          在MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)          在System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32)          在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)          在System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32)          在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr)          在MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)          在System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)          在System.Windows.Application.RunDispatcher(System.Object)          在System.Windows.Application.RunInternal(System.Windows.Window)          在Microsoft.Crm.Tools.PluginRegistration.App.Main()

当插件崩溃时,两个事件日志条目都会同时创建。

我花了最后一次谷歌搜索,试图找到一个至少有类似问题的人,但我失败了:)

有没有解决方案?

3 个答案:

答案 0 :(得分:1)

我之前已经看过类似行为的插件和自定义工作流活动,具体取决于代码中采取的操作。例如,如果我的插件发出http请求,我已经看到PRT崩溃,我不确定,但可能是PRT不允许这种类型的东西,如果它&# 39;在沙盒环境中进行调试。

直接调试自定义工作流活动或插件的另一种方法是创建一个新的自定义实体,其中包含一些字段来存储信息,例如代码运行的用户ID,插件名称或工作流活动,异常消息,然后在代码中写入StringBuilder对象的方式与将有用信息写入跟踪对象的方式相同。在catch块中或总是在代码的末尾,您可以创建自定义实体的新记录并存储来自StringBuilder和插件上下文等的信息。我已经在很多我想要的情况下使用它只要插件不需要抛出将回滚事务的异常,就可以输出用于调试或测试的自定义详细信息。添加额外的代码来输出你想要的东西似乎很乏味但是如果调试不是一个选项,那么这将是有效的。

示例代码来说明我的意思......

Dim tracer As New StringBuilder
Try
    tracer.Append("running code ...")
    '// do some code here
    tracer.AppendLine("done")

    tracer.Append("running more code ...")
    '// do some code here
    tracer.AppendLine("done")

    '// Write out some info useful for debugging
    tracer.AppendLine(String.Format("value of variable 1 {0}", SomeVariable1))
Catch ex As Exception
    tracer.AppendLine(ex.ToString)
End Try

'// Create a new instance of the new custom error entity and save it
'// Where CustomError is the name of your new entity, assuming you're using strongly-typed entity classes
Dim ErrorObj As New CustomError With { 
    .UserName = "",
    .Message = tracer.ToString
    }

pluginOrgService.Create(ErrorObj)

答案 1 :(得分:1)

我已经联系了MS支持,与他们交换了几天的电子邮件,甚至与他们的支持进行了远程会话,然后等待了几天他们的支持来分析问题,从来没有得到MS支持的任何解决方案,并且最后,我自己克服了这一点。

这里的问题是工具,因为我想向MS报告,但出于某种原因,他们确信问题出在我的自定义代码上。我设法将此范围缩小到我制作的一个特定自定义工作流程,我们称之为 Workflow_A 。当插件注册工具(PRT)尝试从CRM获取工作流列表时(我使用了Fiddler,在该请求中没有订单),Workflow_A首先在该列表中,PRT无法解析它并崩溃。然后,我删除了该工作流程并再次重新创建它(相同的步骤和条件)并且瞧,它在工作流程列表中结束,PRT停止崩溃。

AK3800 声明

  

如果我的插件执行了http请求我已经看到PRT崩溃了,我不确定但是如果它在沙盒环境中进行调试可能是PRT不允许这种类型的事情。 / p>

我不得不同意他的观点 - PRT正在解决更多问题(通过调试),所以最后我最终用跟踪日志填充我的代码并且没有调试,只是根据跟踪日志进行代码更改。

答案 2 :(得分:0)

我打开MS的支持票。它们也支持SDK工具。

相关问题