Last post Sep 17, 2020 08:37 AM by Sean Fang
Sep 16, 2020 12:05 AM|suvo|LINK
From my SSIS package when service endpoint http://abc.com/api/GetList is being called ,exception “Runtime error Exception has been thrown by the target of an invocation”
from Script task” is thrown.
I am not able to debug the service task break point is not getting hit.Please help
Sep 16, 2020 02:07 AM|Sean Fang|LINK
You cannot just provide that ambiguous error message since it is completely generic that we could not target what was wrong.
To read the main error message you can add a try catch clause into your code and use Dts.FireError() method to throw the real exception.
public void Main()
string strMessage = Dts.Variables["User::FinalTieOut"].Value.ToString();
Dts.TaskResult = (int)ScriptResults.Success;
Dts.Events.FireError(0,"An error occured", ex.Message,String.Empty, 0);
Dts.TaskResult = (int)ScriptResults.Failure;
Apart from that, you might need to provide more detailed information about the problem. Including, the problematic codes, the try-catch error message and anything you think might be related to this problem.
There are few possible reasons that you might need to think about:
Thank you for understanding. Looking forward to your further details.
Sep 16, 2020 05:14 AM|suvo|LINK
Actually I am unable to debug..break point is not hitting please suggest how can I hit the break point.
Sep 16, 2020 07:01 AM|Sean Fang|LINK
Could you please share the related codes?
I already provided you with the sample codes which will print the detailed error message. Is there anything difficult for you to modify your original codes?
What do you mean "unable to debug...break point is not hitting"?
Which one is your situation? a) You already set the break point and it is not reached or
b) You are not able to set the break point?
Sep 16, 2020 01:13 PM|suvo|LINK
I have already set the break point and it is not reached
Sep 16, 2020 05:15 PM|suvo|LINK
i could get the breakpoint attached..in local when i am debugging i am able to get the response...But when it is scheduled to run in my production server at a particular time it is falling giving us this error in ssis package logs
Sep 17, 2020 08:37 AM|Sean Fang|LINK
So the problem now becomes that the codes works in local but not work on production server, correct?
Could you please show me the problematic codes?
Some other directions to narrow down the problem