1

异常类提供了许多属性,这些属性将提供有关引发异常的更多含义的完整详细信息。

InnerException-->Gets Exception instance that caused the current exception.

Message-->Gets a message that describes the current exception.

Source--> Gets or sets the name of application or object that causes the error.

StackTrace -->Gets a string representation of immediate frames on the call stack.

Public property -->TargetSite Gets the method that throws the current exception.

但有时它没有任何意义。

at Microsoft.SharePoint.SPList.GetItemById(String strId, Int32 id, String strRootFolder, Boolean cacheRowsetAndId, String strViewFields, Boolean bDatesInUtc) 
   at Microsoft.SharePoint.SPList.GetItemById(Int32 id) 
   at JafraWFTest.JafraCustomWFActivity.<Execute>b__0() 

在这种情况下,我不知道导致异常的任何内容、行号或类名。

那么如何找到导致异常的类名。

4

1 回答 1

0

Please add some clearance to your question.

  1. Where do you get exception? Is it your custom code, or workflow in SP Designer?

  2. Is JafraWFTest.JafraCustomWFActivity your code or some 3rd party?

  3. Where do you get logs, 14 Hive\Logs ?

so how to find the class name which causing the Exception .

The class which trows exception is JafraWFTest.JafraCustomWFActivity. It's a custom workflow action. The exception is throwing when it's being executed. <Execute>b__0() this means that JafraWFTest.JafraCustomWFActivity implements generic interface for workflow action with Execute method.

So if JafraWFTest.JafraCustomWFActivity is your code look for JafraCustomWFActivity class in JafraWFTest namespace and Execute method. If it's a 3rd party code. Try to look for JafraWFTest assembly (dll) in application BIN directory or GAC. And the other should be the same as for your code case.

From code semantic I assume that it's a test for custom workflow action. Check if JafraWFTest assembly should be installed to GAC for it and test environment (site, list, list items) is properly configured.

于 2013-03-04T13:57:47.657 回答