Home » C# Programming

Exception before it goes to Break point line in Script Component

it seems me to be Bad Data, but I can not catch this exception.

After my OleDb source, I am calling script component for Data tranformation, I out Break point on various location

like UserComponent.ProcessInput definition.and on all the method in ScriptMain class.

Error message of "Object reference not set to an instance of an object."

I get following error detail

 at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)

   at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)

   at UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)

   at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer).


Can any body suggest how to catch this error.





7 Answers Found


Answer 1

From my little experience, breakpoints inside data  flows (script components or not, but specially script  components) don't work.

Use System.Diagnostics.Trace, run the package with DTExec.exe and see the output in DebugView.


Answer 2

Paulo is correct - script  components can't be debugged with breakpoints, allegedly due to the threading involved in the pipeline.

I prefer using ComponentMetaData.FireInformation instead of the calls from the Diagnostics namespace.


Answer 3

It seems to me that none of my break  point are working..which is separate issue, but yet making the one above more complicate.

Is not catching Break point  in the Script Component is known issue.



Answer 4

Just be aware that, although it doesn't set  your package in fire, it does fire the OnInformation event that will be propagated up to the top level package (unless you explicitly tell it not to).

But that's the sure way to get runtime info in Visual Studio's ouput window.


Answer 5

None of your breakpoints in a script  component will work.  That's the definition  of "you can't use breakpoints in a script component."  They're not supported.  It's a known issue.  You can't use them.  Don't try.

Use FireInformation, or MessageBox.Show instead.


Answer 6

Thanks Paulo and Todd.

I used MessageBox.Show for now ,

I am going to explore more on System.Diagnostics.Trace

cause when I am processing thousands of record and multiple column per row, catching bad  data is vry tedious and time consuming.




Answer 7

You may want to use this technique instead: Using the data  Viewer Intelligently in SSIS Data Flows.


I have a package Which contains one DataFlowTask and ScriptTask in it. My intention is to view the variable value at run time while package is running in debug mode.


So for that I have set break point in DataFlowTask to Watch variable values at runtime. After hitting the break point, I executed the package. DataFlowTask Executed successfully but ScriptTask didn’t get executed. It didn’t give any error also. Just it hanged by showing yellow. No response at all.


If I replace the script task with any other task it is working fine.


Why this problem has occurred with script task?. Am I supposed to set some properties so that script task will execute successfully.



I have faced the same problem, If I set ‘DataViewers’ in DataFlowTask.


Please suggest some way to handle this scenario. Thanks in Advance.



Hi all

Up until 29th of December 2010, my "Script Task" breaking points was working like a charm. Not anymore. My code seems to ignore them altogether. There is a blog posted by Hoot at http://www.windows-tech.info/15/0a0c4b5f99ba9ab5.php that shows the same problem I am having. Like he said, I've done pretty much everything right and still isn't working. I thought of the possibility of code out of synch with debug, but I've compiled and recompiled several times and won't help.

The one comment I have is that it all started after placing a "Stop" code on my script. I was thinking that maybe I changed a setting inadventently when the request for debug window poped up. I don't know.

Any help?



I am trying to stop the data flow when certain conditions happen in the script component. Like if a row in the data set has an invalid date, I dont want that dataset to be inserted in the tables or go through OLEDB Destination, rather I want the entire data flow for that dataset to stop and go back to the control flow page.


I have tried mulitple solutions but nothing worked. Conditional Split ends up inserting the correct rows, but I just dont want anyting to be inserted when one row is bad, where as I do want the entire dataset to be inserted if all rows are good.

How can I fail the component when certain conditions happen int eh script component.

help pls




With this code I draw sine shape but I need to connect two points, because when is distance from two points larger then I have empty space between them, but I need this two point to be conected with line.

Option Strict Off
Option Explicit On
Imports System
Imports System.IO.Ports
Imports System.Threading.Thread
Imports System.Drawing

Protected g As Graphics
Protected a As GraphClass
Protected Gain As New Single
Private Intersection As Point = New Point(FrameCoord.HorizontalDisplacement, FrameCoord.X_Axis_VertLoc)

Public Sub PlotPoint(ByVal X As Integer, ByVal Y As Integer, Optional ByVal pn As Pen = Nothing)

  Dim xp As Integer = (-Y + FrameCoord.X_Axis_VertLoc) * Gain

  If pn Is Nothing Then
    g.DrawLine(Pens.White, New Point(X + Intersection.X, xp), New Point(X + 1 + Intersection.X, xp + 1))
    g.DrawLine(pn, New Point(X + Intersection.X, xp), New Point(X + 1 + Intersection.X, xp + 1))
  End If

End Sub


I assume that I need to use some kind of this code below for connecting two points, but how to calculate right coordinates from code above for point1 and point2 ?


g.DrawLine(Pn, Point1, Point2)


Thanks in advance,


Hi All,

  I am facing one strange issue in SSIS 2008. I have developed one SSIS package which is importing excel data into SQL Server 2008. This Package contains some Scirpt componants. This package is working fine on Windows XP machine but when I am trying to run on Windows 2003 server it gives me error "[SSIS.Pipeline] Error: component "SCR RDSTableRelation" (48) failed the post-execute phase and returned error code 0x80004002". Surprising thing is that if on windows server 2003server  if I drag a new script componat and paste the previous script code itself then it works fine. Even if I copy-paste the existing script componant and give source-destination connectino to this new script componant then also it works.


Steps to re-produce the behavior:

·     Add a New report item.

·     Add a Dataset with following data.

·     sers catg datp
2007 13 12
2007 14 10
2007 18 2
2007 19 3
2007 20 8
2007 21 2
2007 22 5
2007 23 4
2007 24 6
2007 25 2
2007 26 2
2007 28 3
2007 29 4
2007 30 1
2007 31 2
2007 32 2
2007 33 4
2007 35 2
2007 36 4
2007 37 2
2007 38 2
2007 39 1
2008 13 1
2008 15 1
2008 16 3
2008 17 2
2008 18 2
2008 20 1
2008 21 3
2008 28 1
2008 29 4
2008 30 2
2008 31 1
2008 32 6
2008 33 1
2008 34 1
2008 35 5
2008 37 8
2008 38 2
2008 39 2

·     Add a Chart control into the report. In the popup Select Chart Type dialog, select Line with Markers and then click OK.

·     Click the chart twice and when the Chart Data pane is displayed.

  Drop datp in data fields area.Right Click datp and select Series Properties...Change [Sum(datp)] to datp in Value field: Select [catg] in Category field:Click OKDrop catg in category fields area.Drop sers in series fields area.

·     Right click X-Axis (Catg Axis)

Specify 1 as Interval:Click OK

Preview the Report:

Please See how for 2008 series the line jumps from 13 to 18 skipping 15,16 and 17 then jumps to 34 skipping 20, 21, 28, 29, 30, 31, 32 and 33 and so on. Finally it comes back to 15 from 39.


Please advise.

Amarjot Singh

I was profiling an asp.net 2.0 application for number of exceptions thrown. When I checked the .net clr exception counter it shows a steady increase in the number. I then worker process and chose debug-> Exceptions with break into debugger. I have also unchecked the option Enable Just My Code in Tools -> Options - Debugging - General, but still the debugger doesn't hit and the exception counter shows a rise when I do some stuff on the application.

Any ideas on this.

I have been trying to debug code that calls GetOpenFileName.
I found that if I enable breaking when "Win32 Exceptions" are thrown, that my program fails when I debug over GetOpenFileName.
This is the message I am shown as it fails:

First-chance exception at 0x761eb727 (KernelBase.dll) in <myapp's name.exe>: 0x000006BA: The RPC server is unavailable

If I disable breaking when "Win32 Excpetions" are thrown, I can debug it fine.
Also if I run it without debugging it runs fine.

From what I have been able to dig up (over about 2 days of investigation) is that there might be some sort of WMI (?) service that I might not have the correct rights to allow me to debug stepping over GetOpenFileName.
Note that this idea of why COULD BE COMPLETELY WRONG.

I would like to be able to be able to leave on the break when a Win32 exception is thrown, because I am trying to track down a very difficult to find bug.
Any thoughts on how I can leave that setting on, and still be able to debug over GetOpenFilename?



Hi All,

We have developed the package in SQL Server Business Intelligence Development Studio 2005 . here working fine with out getting any error.

Same package we are not able run in SQL 2008 machine. we have upgrade the package BIDS 2008.Still we are getting below error:

: [ActiveX Script Task]: User script threw an exception: "An error occurred while adding the managed SSIS type library to the script host. Verify that the DTS 2000 runtime is installed

we have run the SQLServer2005_DTS.msi file also even thought we are getting same problem.


We are calling below ActiveX Script

Set rstMsdb = CreateObject("ADODB.RECORDSET")
  rstMsdb.CursorType = 2
  rstMsdb.Open "select max(Starttime) From tbDtsLog where name='WOSYST to BI - Transfer and Process'  And EndTime is not null ", DTSGlobalVariables("getConnectionMsdb").value
  If  err.description="Cannot open database requested in login 'BI_Central'. Login fails." then
   Dim fso, f1, ts, s
   Const ForReading = 1
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f1 = fso.CreateTextFile("Error_Log.txt", True)


Please help me




Hi everyone


I am new to SSIS and this is what i am getting when trying to process .csv file in to database. Can any one let me know why this is happening. This is not happening all the times.


Error: The script threw an exception: Exception of type 'System.OutOfMemoryException' was thrown


hello everyone

And how can I trace my VC++ program step by step and see changing values (of variables) after each instruction has executed?


I'm working on a simple checkers game in C#. I was making a test run, one of my moves didn't go correctly, so I fired up the debugger, but first I placed a break point at where I suspected the problem to be at. Well, I figured out the problem that was causing things not to go right, but I didn't find out what the cause of the problem was.

As I was debugging, I found that if I placed a breakpoint along the correct path in the code that I had intended it to follow, the outcome is correct and there is no problem.


if (target == null)

I WANT target to not be null and enter the else clause. If I had set a break point inside the if clause, then that's where the program flow would go when I tried to make the move that was causing the problem. However, if I placed the breakpoint inside the else clause instead, that's where the program flow would go and the move would go as intended. If I placed breakpoints at both locations, it would always hit the second one in the else clause and never hit the first at all.

Any ideas on why it does this?


I am having a weird issue with break points.  Example.   My car class has no break points when my asp.net mvc web app is not running / debugging.  When I click the Start Debugging button a break point mysteriously appears in my Car class.  I can remove the break point during my debug session only to have it show back up the next debug session.  It's bizarre how a break point does not show up at edit time but mysteriously shows up at debug time.  Not sure how to kill off this break point.


Any one else run into this?






I have an ASP.NET MVC 2 app in VS2010.   My Main.aspx page has javascript that is used to setup initial app/view state.  I can set break points in my JS in my Main.aspx but they never get hit.   If I add a debugger; statement to the JS in my Main.aspx it gives me the option to launch a new visual studio instance and attach a js debugger.   This works but I lose all all the break points which I set at design time.  

The other option I have tried is launch IE manually then manually attach my VStudio to the IE process.  No break points ever get hit this way either.  How do I set break points at design time and then keep those breakpoints when the switch to runtime is made?  I was hoping not to have to switch to another JS debugger (Chrome, Firefox).




I am new to FxCop creating custom Rule

I followed this article http://blogs.msdn.com/b/codeanalysis/archive/2010/03/26/how-to-write-custom-static-code-analysis-rules-and-integrate-them-into-visual-studio-2010.aspx?wa=wsignin1.0

I could do every thing except this

For command line arguments specify
/out:"results.xml" /file:"MyCustomRules.dll" /rule:"MyCustomRules.dll" /D:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop"

and I could not hit the break point.

Please let me know what could be the problem

Thanks in advances.


Hi, I am using Visual Studio 2010 and I need to debug javascript. If I put breakpoint in .js file, when that breakpoint is hit, debugger pauses execution and I can continue statement by statement.

But if I put that breakpoint inside script tag directly in page, debugger doesn`t stop on that breakpoint. If I put that breakpoint in the same line but not in source page (.aspx), but into that dynamically created, it works.

Problem looks to me that it doesn`t take breakpoints from original file, so I need to put breakpoints into that dynamic file each time I press F5.

Can I fix it?




   I have already create a simple web service using C#,and then create a UnitTest project ,

When I run the tests ,it's ok, but if I setup a breakpoint (f9) and try to trace the program .

the breakpoint never stopped .

  so my question is How to setup a breakpoint in UnitTest.


Lin Kejian



In my asp.net application , break point is not working in one application . but i created one sample application there itself its working properly. I dont  know waht is the reason the break point doesnt not working in my one application.  The application is running on local iis and i created the vertual directory also. I checked with Debug menu attach process. But still the problem is not solved. and also i un install the visual studio.net and visual source safe also.  Again the problem came with break point issue. So anybody kindly help to solve this issue. Last two days i am spending my time to solve this problem. So send the solution as an urgent

 Note :

          I can set the Break Point. But while i am  running the application, the control will not come to that break point. and the break point show with one error warning symbal also.


Please give me some tips to solve this one with step by step

send mail to muji85a@hotmail.com


Hi Friends,

I am using Visual Studio 2005 with Windows 7. The Problem is when i start debugging it doesn't stops at Break Points.

Debug = "True"  in web.config

Please Help me if anybody can !!


Thanks & Regards,

Piyush Anand


I have developed a custom debug engine and wanted to know how I could get the count of break points that have been visually set in the editor.  right now I get all the pending break points through




this causes some problems for me, and it causes some synchronization problems with my external debugger.  I wanted to know how to enumerate all the berakpoints that have been visually set in the editor before they get called by







<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure