I am executing an SSIS package on the command line with dtexec.exe
. The package calls MessageBox.Show()
and MsgBox()
(C# and VB.NET, respectively) for showing errors. The boxes are hanging the automated job processor since it is waiting for the box to close.
I was under the impression that the boxes should be hidden when not in Interactive Mode. Can the message boxes be suppressed without modifying the SSIS package? The package is from a software vendor and I really shouldn't be changing it.
EDIT: The full command I am using (edited to remove details)
C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe /F D:\Path\To\Package.dtsx /Conn DBConnection;"Provider=SQLOLEDB;Data Source=SERVER;Initial Catalog=DB;Integrated Security=SSPI;Connect Timeout=60" \Package.Variables[User::InputFileName].Properties[Value];C:\Path\To\Input.csv
EDIT2: Example of message box code. This is in a script task.
Public Sub Main()
MsgBox("Failed to read/parse input file or generic database failure while running " + Dts.Variables("System::PackageName").Value.ToString() + ". Please check the layout of the feed and database connectivity.")
Dts.TaskResult = ScriptResults.Failure
End Sub
EDIT3: If anyone in the future is interested in the code to test for InteractiveMode. It must also be passed in via the Script Task's ReadOnlyVariables. I ended up modifying the package since there were other issues.
VB.NET
If CBool(Dts.Variables("System::InteractiveMode").Value) = True Then
....
End if
C#
if ((bool)Dts.Variables["System::InteractiveMode"].Value == true)
....
}