2017-06-21 68 views
2

我想使用插件註冊工具(從現在開始引用爲PRT)通過CRM 2016在線調試自定義工作流活動。我的問題是,每當我點擊「配置文件工作流程」按鈕時,PRT崩潰。客戶關係管理2016在線 - 調試自定義工作流活動崩潰插件註冊工具

有關崩潰的詳細信息可以在事件日誌中找到並在下面說明。

事件日誌條目之一:

錯誤的應用程序名稱:PluginRegistration.exe,版本:8.2.1.8676,時間戳:0x58d073d5 錯誤模塊名稱:KERNELBASE.dll,版本:10.0.15063.296,時間戳:0xa0527b0c 異常代碼:0xe0434352 故障偏移:0x0000000000069e08 出錯進程ID:0xb70 錯誤應用程序開始時間:0x01d2ea6794b7727a 錯誤的應用程序路徑:d:_temp \ SDK \工具\ PluginRegistration \ PluginRegistration.exe 錯誤模塊路徑:C: \ WINDOWS \系統3 2 \ KERNELBASE.dll 報告編號:21f5bf85-22be-44ca-b884-ef43d9490886 斷裂作用包全名: 斷裂作用包相對應用程序ID:

事件日誌項二:

應用:PluginRegistration.exe Framework版本:v4.0.30319 描述:由於未處理的異常而終止進程。 異常信息:System.Xml.XPath.XPathException at MS.Internal.Xml.XPath.XPathParser.CheckToken(LexKind) at 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) at MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(MS.Internal.Xml.XPath.AstNode) at MS .Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(MS.Internal.Xml.XPath.AstNode) at MS.Internal.Xml.XPath.XPathParser.ParseAdditiveExpr(MS.Internal.Xml.XPath.A stNode) 在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) at MS.Internal.Xml.XPath.XPathParser.ParseXPathExpresion(System.String) at System.Xml.XPath.XPathExpression。編譯(System.String,System.Xml.IXmlNamespaceResolver) at System.Xml.XPath.XPathNavigator.Compile(System.String) at 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) at PluginProfiler.Library.WorkflowXamlUtility.GetWorkflowActivitySteps(Microsoft.Xrm.Tooling.Connector.CrmServiceClient,System。字符串) 在Microsoft.Crm.Tools.PluginRegistration.CommonControls.ExistingWorkflow.Refresh() 在Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.set_SelectedWorkFlow(Microsoft.Crm.Tools.PluginRegistration.CommonControls.ExistingWorkflow) 微軟.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.RefreshWorkflows() at 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.MenuI在System.Windows上的System.Windows.Controls.MenuItem.InvokeClickAfterRender(System.Object) 處的MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(System.Windows.Input.ICommandSource,布爾型)上的tem_Clicked(System.Object) 。 Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate) at System。 Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean) at System.Threading.ExecutionContext.Run(System.Threading .ExecutionContext,System.Threading.ContextCallback,Syst在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object) 在MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext,System.Event.Object,Boolean) 。 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) at MS.Win32.HwndWrapper.WndProc(IntPtr,Int32,IntPtr,IntPtr,Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading。 ExceptionWrapper.InternalRealCall(System.Delegate,S ystem.Object,Int32)將 在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object的,System.Delegate,System.Object的,的Int32,System.Delegate) 在System.Windows.Threading.Dispatcher.LegacyInvokeImpl(系統。 Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr) at MS.Win32.UnsafeNativeMethods.DispatchMessage(System。 Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) at System.Windows.Application.RunDispatcher(System.Object) at System.Windows.Application.RunInternal (System.Windows.Window) at Microsoft.Crm.Tools.PluginRegistration.App.Ma in()

兩個事件日誌條目是在插件崩潰的同時創建的。

我已經花了去年我們的google搜索,試圖找到一個具有至少類似的問題,但我失敗了:)

對此有任何解決方案?

回答

0

我打開MS支持票。他們也提供對SDK工具的支持。

1

根據代碼中採取的操作,我已經看到過使用插件和自定義工作流活動的行爲。例如,如果我的插件執行了一個http請求,我已經看到這會導致PRT崩潰,但我不確定,但可能是因爲PRT在沙盒環境中調試時不允許這種類型的事情。

直接調試自定義工作流活動或插件的替代方法是創建一個新的自定義實體,其中包含一些字段用於存儲信息,例如代碼運行時的用戶標識,插件名稱或工作流活動,異常消息等等,然後在代碼中寫入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

我已經聯繫MS支持,與他們交換電子郵件情侶OD天,甚至不得不在他們的支持的遠程會話,然後等待着對夫婦更他們支持分析問題的日子,從來沒有從MS支持獲得任何解決方案,最後我自己解決了這個問題。

問題在於工具,因爲我想向MS彙報,但由於某些原因,他們確信問題出在我的自定義代碼上。我設法將其縮小爲我製作的一個特定自定義工作流程,我們稱之爲Workflow_A。當插件註冊工具(PRT)嘗試從CRM獲取工作流列表(我使用Fiddler時,該請求中沒有訂單),Workflow_A首先在該列表中,PRT無法解析它並崩潰。然後,我刪除了該工作流並重新創建了它(相同的步驟和條件),結果是工作流列表中的最後一個和PRT停止崩潰。

AK3800

如果我的插件不http請求我已經看到了崩潰PRT,我不知道是肯定的,但它可能是PRT不允許類型如果它正在沙盒環境中進行調試。

我不得不同意他的觀點 - PRT解決了更多問題然後解決(調試),最後我終於用遍歷代碼填充我的代碼,沒有調試,只是根據跟蹤進行代碼更改日誌。

+1

這是我見過的確切問題:「試圖執行http請求時,插件註冊工具崩潰」我的解決方法與您的解決方法相同:添加其他跟蹤並希望解決問題。我也嘗試將邏輯(包括http調用)分離成單獨的類,然後我可以單獨進行調試 – jasonscript

相關問題