BIML从不正确生成Package ProtectionLevel

时间:2016-08-30 10:12:40

标签: bids ssis-2012 biml

我已将项目级别保护级别设置为EncryptSensitiveWithPassword,并且在我使用BIML生成的所有包中,我都有以下代码

<Package Name ="MyPackage" ProtectionLevel="EncryptSensitiveWithPassword" PackagePassword="mypass">

出于某种原因,我必须在每次使用BIDS Helper生成包之后手动将ProtectionLevel设置为EncryptSensitiveWithPassword。这是一项痛苦的工作。我不知道为什么不能工作。有线索吗?

我正在使用从Codeplex和SQL Server Data Tools 2012版下载的1.7.0版BIDSHelper(因为您可能已经知道令人困惑的部分是VS版本是2010)

更新 下面是iamdave推荐的biml的新结构,它没有在ProjectSubPath中生成任何输出,并且ExceptionDataMigrator包仍然生成默认的packlage保护

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Projects>
        <PackageProject ProjectSubpath="bimlOutput"
                Name = "Solution/Project"
                ProtectionLevel = "EncryptSensitiveWithPassword"
                ProjectPassword = "password"
                >
            <Parameters>
                <Parameter Name="sTestParam" DataType="String">This is project parameter</Parameter>
            </Parameters>
            <Packages>
                <Package PackageName="ExceptionDataMigrator">

                </Package>
            </Packages>

        </PackageProject>
    </Projects>
    <Connections>
        <Connection Name="Staging" CreateInProject="true" ConnectionString="Data Source=b.database.windows.net;User ID=h;Initial Catalog=Migration_Staging;Password=z;Provider=SQLNCLI11.1;Auto Translate=False;" RetainSameConnection="true" />
        <Connection Name="Reporting" CreateInProject="true" ConnectionString="Data Source=Dev2;Initial Catalog=ng;Provider=SQLNCLI11;Integrated Security=SSPI;Auto Translate=false;" RetainSameConnection="true" />
        <Connection Name="SalesForceDB" CreateInProject="true" ConnectionString="Data Source=db;Initial Catalog=SalesForce;Provider=SQLNCLI11;Integrated Security=SSPI;Auto Translate=false;" />
    </Connections>
    <Packages>

    <Package Name="ExceptionDataMigrator" ConstraintMode="Linear" ProtectionLevel="EncryptSensitiveWithPassword" PackagePassword="password">
        <Parameters>

1 个答案:

答案 0 :(得分:0)

您是在与BIML文件相同的VS项目中创建软件包还是作为一个全新的解决方案?如果我没记错,我遇到了类似的问题并通过在ProjectSubPath <PackageProject>节点中指定<Projects>来解决它,因为在我的BIML项目中创建的包继承了保护级别BIML项目:

<Projects>
    <PackageProject
            ProjectSubPath = "Folder to save new solution"
            Name = "Solution/Project Name"
            ProtectionLevel = "EncryptSensitiveWithPassword"
            ProjectPassword = "Password"
            >
        <Parameters>
            <!-- Add Parameters here -->
        </Parameters>
        <Packages>
            <Package PackageName = "Package 1" />
        </Packages>
    </PackageProject>
</Projects>

非常小心指向ProjectSubPath,因为它会完全删除该地址已存在的任何文件夹,无论其包含什么内容,然后重新创建并创建新解决方案内。