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 :ermm:
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