Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSIS - create a script task programatically (the binary code for the script is not found) Expand / Collapse
Author
Message
Posted Wednesday, May 7, 2014 2:21 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 12:31 PM
Points: 6, Visits: 240
Hi,

I wrote a script task that´s build a SSIS Package dynamically with a Script Task.
When I open this dynamically created package, the Script Task shows with error and "the binary code for the script is not found" message.

But, when I open the Script Task, closes and click "Ok", the error disappears ...
Is there a way to fix this, without needs to open in BIDS ?

This is the reference to dinamically script task:
http://stackoverflow.com/questions/18611319/set-script-task-code-dynamically-in-ssis-2012

Thanks and sorry my broken english
Post #1568687
Posted Wednesday, May 7, 2014 2:32 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:46 PM
Points: 1,978, Visits: 5,146
marcelo.negrisoli (5/7/2014)
Hi,

I wrote a script task that´s build a SSIS Package dynamically with a Script Task.
When I open this dynamically created package, the Script Task shows with error and "the binary code for the script is not found" message.

But, when I open the Script Task, closes and click "Ok", the error disappears ...
Is there a way to fix this, without needs to open in BIDS ?

This is the reference to dinamically script task:
http://stackoverflow.com/questions/18611319/set-script-task-code-dynamically-in-ssis-2012

Thanks and sorry my broken english


The ScriptingEngine.SaveProjectToStorage() wasn't successful, it writes the binary script code to the package, and the error message says that it's missing.

I did solve this by saving the package to a file/db storage and reload it before execution.
Post #1568691
Posted Wednesday, May 7, 2014 2:55 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 12:31 PM
Points: 6, Visits: 240
Eirikur Eiriksson (5/7/2014)
marcelo.negrisoli (5/7/2014)
Hi,

I wrote a script task that´s build a SSIS Package dynamically with a Script Task.
When I open this dynamically created package, the Script Task shows with error and "the binary code for the script is not found" message.

But, when I open the Script Task, closes and click "Ok", the error disappears ...
Is there a way to fix this, without needs to open in BIDS ?

This is the reference to dinamically script task:
http://stackoverflow.com/questions/18611319/set-script-task-code-dynamically-in-ssis-2012

Thanks and sorry my broken english


The ScriptingEngine.SaveProjectToStorage() wasn't successful, it writes the binary script code to the package, and the error message says that it's missing.

I did solve this by saving the package to a file/db storage and reload it before execution.


Thanks for reply !

I did this:

// 9. Persist the VSTA project + binary to the task
if (!task.ScriptingEngine.SaveProjectToStorage())
{
throw new Exception("Save failed");
}

// 10. Cleanup
task.ScriptingEngine.DisposeVstaHelper();

// 11. Save
string xml;
pkg.SaveToXML(out xml, null);

File.WriteAllText(@"c:\\test.dtsx", xml);

The "9. Persist the VSTA project + binary to the task" does not return any error
.. and I open the c:\test.dtsx in BIDS. When I try to execute, the error shows off

The "saving the package to a file/db storage and reload it before execution." could be intended as "open the c:\test.dtsx in BIDS and try to execute" ?

Thanks again
Post #1568699
Posted Wednesday, May 7, 2014 3:14 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 1:46 PM
Points: 1,978, Visits: 5,146
When you run it in BIDS, it is compiled before the execution, which is the step missing. I'll look into this when I can and will let you know.
Post #1568710
Posted Wednesday, May 7, 2014 3:31 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 12:31 PM
Points: 6, Visits: 240
Thank you Eirikur Eiriksson
Post #1568714
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse