Can't output statements to Output window in Visual Studio 2019

Manny 151 Reputation points
2022-02-11T04:35:44.69+00:00

Hi
I am using Visual Studio 2019 to create SSIS package. I am using C# to write the script. I need to troubleshoot the script so I am using print statements to see what the variable values are. I cannot get anything to show up in the Output window. I tried this statement:

System.Diagnostics.Debug.WriteLine("hi debug");
Console.WriteLine("hi console");

Neither works.

Any suggestions on how to get this working?

Thank you

Developer technologies | Visual Studio | Debugging
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 122.6K Reputation points
    2022-02-11T06:11:02.9+00:00

    Maybe you must enable the logging: https://learn.microsoft.com/en-us/sql/integration-services/lesson-3-add-logging-with-ssis. For example, select the "Windows Event log", and also ScriptTaskLogEntry event, and use the Events system tool instead of Output window.

    To write the logs, use Dts.Log or Dts.Events.FireInformation: https://learn.microsoft.com/en-us/sql/integration-services/extending-packages-scripting/task/logging-in-the-script-task.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.