1
votes

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);
Biml isn't going to support what you're attempting to do. You'll either need to buy Mist to get that functionality or use the .net object model-either direct said or an abstraction layer like the EzAPI - billinkc
Thanks. Does that mean that it will be possible if I buy MIST? - Søren Sparsø
Correct. Purchasing Mist will give you the ability to reference the biml.dll which has no restrictions on usage. You could also change your approach at that point and instead of generate XML -> transform to SSIS just use the Ast*classes to directly instantiate your SSIS objects - billinkc