Como has notado, los métodos auxiliares de VSTA disponibles en 2008 se movieron o se eliminaron en 2012. Sigue siendo posible, pero el código ha cambiado.
La ruta más sencilla es cargar un proyecto existente con VstaHelper.LoadProjectFromFolder().
Para añadir archivos de script dinámicamente, ten en cuenta dos cosas. Las clases ScriptingEngine y VstaHelper representan VSTA en sí — ahí es donde se crea el proyecto y se añaden los archivos, y no puedes eliminar ni reemplazar un archivo existente ahí. Llamar a SaveProjecToStorage() es como cerrar la ventana de VSTA: escribe el proyecto y el binario compilado de vuelta en la Script Task.
Por el contrario, ScriptTask.ScriptStorage te permite manipular el contenido del archivo de origen directamente.
static void Main(string[] args) { // 1. Create a new package and add a script task var pkg = new Package(); var exec = pkg.Executables.Add("STOCK:ScriptTask"); var th = (TaskHost)exec; th.Name = "Script Task"; th.Description = "This is a Script Task"; var task = (ScriptTask)th.InnerObject; // 2. Set the script language - "CSharp" or "VisualBasic" task.ScriptLanguage = VSTAScriptLanguages.GetDisplayName("CSharp"); // 3. Set any variables used by the script //task.ReadWriteVariables = "User::Var1, User::Var2"; // 4. Create a new project from the template in the default path task.ScriptingEngine.VstaHelper.LoadNewProject(task.ProjectTemplatePath, null, "MyScriptProject"); // 5. Initialise the designer project, add a code file, build //task.ScriptingEngine.VstaHelper.Initalize("", true); //task.ScriptingEngine.VstaHelper.AddFileToProject("XX.cs", "FileContents"); //task.ScriptingEngine.VstaHelper.Build(""); // 6. Persist the VSTA project + binary to the task if (!task.ScriptingEngine.SaveProjectToStorage()) { throw new Exception("Save failed"); } // 7. Replace the ScriptMain contents var contents = File.ReadAllText("path to file"); var scriptFile = task.ScriptStorage.ScriptFiles["ScriptMain.cs"] = new VSTAScriptProjectStorage.VSTAScriptFile( VSTAScriptProjectStorage.Encoding.UTF8, contents); // 8. Reload, build and save task.ScriptingEngine.LoadProjectFromStorage(); task.ScriptingEngine.VstaHelper.Build(""); if (!task.ScriptingEngine.SaveProjectToStorage()) { throw new Exception("Save failed"); } // 9. Cleanup task.ScriptingEngine.DisposeVstaHelper(); // 10. Save the package string xml; pkg.SaveToXML(out xml, null); File.WriteAllText(@"c:\temp\package.dtsx", xml); }