Expand BIML files programmatically

夙愿已清 提交于 2020-01-06 02:53:26

问题


Has anyone tried to programatically compile BIML files into dtsx packages? I'm currently writing an application in C#.NET where users can update metadata. When this data has been updated, the BIML files needs to be re-compiled, as SSIS packages will be added/removed upon re-compiling.

In another SO question, it is suggested to copy the functionality from BIDS helper:

Automatically generate SSIS package from BIML script

I have tried this, but I get an error saying:

BimlEngine may only be executed from BidsHelper

This is my code:

        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);

来源:https://stackoverflow.com/questions/30760907/expand-biml-files-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!