question

HARBILASBAL-6065 avatar image
0 Votes"
HARBILASBAL-6065 asked HARBILASBAL-6065 commented

Script task error on refercing GCP dlls

Hi,

I am trying to connect to GCP BigQuery in script task using c#. However, I get the error when package is executed.

I have already loading the assemblies explicitly in the code.

108204-image.png


dotnet-csharpsql-server-integration-services
image.png (23.6 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This is how I have written the inner except code but the issue is that as soon as package is run, it immediately give error pop up.

 catch (Exception ex)
             {
                  Console.WriteLine(String.Concat(ex.StackTrace, ex.Message));
                 if (ex.InnerException!=null)
                 {
                     Console.WriteLine("Inner Exception");
                     Console.WriteLine(String.Concat(ex.InnerException.StackTrace, ex.InnerException.Message));
                 }
    
                 Console.ReadLine();
                 Dts.TaskResult = (int)ScriptResults.Failure;
             }
0 Votes 0 ·

Console.WriteLine isn't going to work inside an SSIS script task as there is no console window. Ideally use FireInformation or equivalent to write the error to the log and then look at the log. Alternatively for quick testing you can use MessageBox.Show although it might not work outside the debugger. Refer to this article on that topic.

0 Votes 0 ·

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered

That particular exception has InnerException set. Within the inner exception is the actual error that occurred. You'll need to pick it apart to see what is failing.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.