Will Debug.WriteLine work in a script component?
I have traditionally thrown message boxes while developing SSIS packages and removing them when finished, but wish to move to something more appropriate. From my understanding, Debug.WriteLine is supposed to output to the console while debugging.In various places I'm calling System.Diagnostics.Debug.WriteLine("Stuff") but nothing comes up in the output console. Am I using this the wrong way?
November 29th, 2006 6:00pm
your problem is mine too. I've never been able to show messages
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2006 11:02am
If you want to see it in the output window, fire an event-
Public Sub Main()
Dim fireAgain As Boolean Dts.Events.FireInformation(0, "MyTask", "Information Log", Nothing, 0, fireAgain)
Dts.TaskResult = Dts.Results.SuccessEnd Sub
November 30th, 2006 11:16am
Debug.WriteLine method has ConditionalAttribute("DEBUG") applied to it, the DEBUG macro is not defined when compiling the scripts, so this method does nothing.Use Darren's code instead.
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2006 11:30am
You could use this code
// C# Code
public override void Input0_ProcessInputRow(Input0Buffer Row)
{
System.Diagnostics.Trace.WriteLine("SomeMessage: " + Row.YourField);
}
and use DebugView to watch the messages:
More info:
http://microsoft-ssis.blogspot.com/2011/04/breakpoint-does-not-work-within-ssis.htmlPlease mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
April 5th, 2011 4:01pm