有没有人试图以编程方式将BIML文件编译成dtsx包?我目前正在C#.NET中编写一个应用程序,用户可以在其中更新元数据。更新此数据后,需要重新编译BIML文件,因为重新编译时将添加/删除SSIS包。
在另一个SO问题中,建议从BIDS助手复制功能:
Automatically generate SSIS package from BIML script
我试过这个,但是我收到一个错误说:
BimlEngine只能从BidsHelper执行
这是我的代码:
List<string> bimlScriptPaths = new List<string>();
bimlScriptPaths.Add(@"C:\Users\soren\Documents\Visual Studio 2013\Projects\Integration Services Project2\Integration Services Project2\BimlScript.biml");
string tempTargetDirectory = "C:\\";
string projectDirectory = @"C:\Users\soren\Documents\Visual Studio 2013\Projects\Integration Services Project2";
ValidationReporter v = BidsHelper.CompileBiml(
typeof(AstNode).Assembly,
"Varigence.Biml.BidsHelperPhaseWorkflows.xml",
"Compile",
bimlScriptPaths,
new List<string>(),
tempTargetDirectory,
projectDirectory,
SqlServerVersion.SqlServer2008,
SsisVersion.Ssis2014,
SsasVersion.Ssas2008,
SsisDeploymentModel.Project);