I have an SSIS package in Visual Studio 2014, and I want to raise an error in a Script Component if any records traverse a particular path out of a 3rd party transformation. I WANT to do this in C# 2012, but the FireError method gives an error:
The best overloaded method match for 'Microsoft.SqlServer.Dts.Pipeline.Wrapper.IDTSComponentMetaData100.FireError(int, string, string, string, int, out bool)' has some invalid arguments
When I try to do this:
bool fireAgain = false;
IDTSComponentMetaData100 myMetaData;
myMetaData = this.ComponentMetaData;
myMetaData.FireError(0, "Script Component", "Invalid Records", string.Empty, 0, ref fireAgain);
but if I change FireError to FireInformation, it compiles and works -- except of course I need an error raised, not an informative event.
Also, if I use Visual Basic instead of C# as so:
Dim pbFireAgain As Boolean = False
Dim myMetaData As IDTSComponentMetaData100
myMetaData = Me.ComponentMetaData
myMetaData.FireError(0, "Script Component", "Invalid Records", String.Empty, 0, pbFireAgain)
Which is, I mean, literally the same exact thing but in a different language, it works fine. VB also works with FireInformation.
Obviously I can solve my immediate problem by using VB, but can someone tell me WHY this is this way? It seems like a specific issue with C#. As evidence, we have this on MSDN: https://msdn.microsoft.com/en-us/library/ms136031.aspx
Where the Script Component version of FireError is the only of eight examples to not have C# and VB versions (the logging one is poorly formatted, but they're both there).
I'm wondering if there's a debugger configuration that threatens to run C# code in an odd way, as this stackoverflow question answered, but the error I get is at design time -- Visual Studio springs the earlier "invalid arguments" error before I compile, so it knows something is off.
Thoughts?