Tips on how to debug ccbpm bug system debugging asp.net iis crash program causes problems

Recently ccflow program at run time iis often leads to crashes, single-step debugging can not find the problem.

But quit vs restart the program, but also it. The first run is no problem for this problem, do not know where the place to start.

For this reason I thought of writing a unit test to test whether you can create a unit test code in ccflow above. as follows

up-1aa3f24f362ddeeedd6bf7343bbd2b5940d.png

The default.aspx Set as Start, successful implementation of the first, the second time it failed.

Therefore I think, must be the underlying code error, rather than the front js cause problems iis crash.

I put a narrow range, execution default.aspx, find the code appears in the first transmission method above.

BP.WF.Dev2Interface.Node_SendWork("001", workid, 102, "liping");

Further narrow the range, it is our core code NodeSend (); approach problems. Because NodeSend this method is relatively large, so I wrote a number of anomalies in the middle.

After testing found that, on a large part of this approach, there is no problem.

I substituting the remaining half of the code, in the narrow half, at an intermediate portion, the increase in

throw new Exception ( "err @ run here, and brush it under the page to check for the problem, if it shows the problem, a problem with the above code.");

This exception, finally located, this method to handle the event a problem.

up-3e46b67aa38f5cf3a4fa30ca0ebef316ffc.png

The same way, in the middle of the method body, add an exception is thrown, repeated several times, finally to locate, send a message when problems caused.

up-835256158daae9a22d1e38067b45044f10d.png

In order not to delay the use, I do log off him.

to sum up:

  1. Encountered similar problems, need to write a unit test, you need to find reproduce the scene.
  2. Found reproduced scene method requires the use of 2 minutes, the code segments by the body, and then find the problem.
  3. Unit testing is the best way to solve the problem.

Guess you like

Origin blog.51cto.com/14150825/2481839