DeploymentContributorConfigurationStream 类

定义

表示 DacFx 在部署和生成过程中使用的配置文件的可流版本。 这些流使部署扩展能够增强和扩展设计和部署体验。

输入配置文件可以在 .sqlproj 文件中定义为 MSBuild 过程的一部分。 这些文件被视为流,并且将通过该方法传递给参与者 Microsoft.SqlServer.Dac.Deployment.DeploymentContributor.EstablishDeploymentConfiguration(Microsoft.SqlServer.Dac.Deployment.DeploymentContributorConfigurationSetup) ,可以在该方法中将其复制为存储在生成的 dacpac 中的输出。

然后 Microsoft.SqlServer.Dac.Deployment.DeploymentContributor.ApplyDeploymentConfiguration(Microsoft.SqlServer.Dac.Deployment.DeploymentContributorContext,System.Collections.Generic.ICollection{Microsoft.SqlServer.Dac.Deployment.DeploymentContributorConfigurationStream}),可以在部署期间使用这些流进行配置和数据。 在方法结束时 Microsoft.SqlServer.Dac.Deployment.DeploymentContributor.ApplyDeploymentConfiguration(Microsoft.SqlServer.Dac.Deployment.DeploymentContributorContext,System.Collections.Generic.ICollection{Microsoft.SqlServer.Dac.Deployment.DeploymentContributorConfigurationStream}) ,将释放所有流。 需要从流获取数据的参与者必须在此方法期间读取和缓存数据 - 尝试在方法期间 OnExecute(DeploymentPlanContributorContext) 从流中读取数据将失败。

在 .sqproj 文件中,部署配置文件指定如下: <ItemGroup><DeploymentExtensionConfiguration Include=“MyContributorName.MyFileName1.sql” /><DeploymentExtensionConfiguration Include=“MyContributorName.MyFileName2.sql” /></ItemGroup>

请注意,所有参与者都可以访问配置流。 参与者可以使用文件命名模式来确定与该参与者相关的输入文件。

public sealed class DeploymentContributorConfigurationStream
type DeploymentContributorConfigurationStream = class
Public NotInheritable Class DeploymentContributorConfigurationStream
继承
DeploymentContributorConfigurationStream

构造函数

名称 说明
DeploymentContributorConfigurationStream(String)

创建 的实例 DeploymentContributorConfigurationStream

属性

名称 说明
Filename

用于表示此流的文件名

方法

名称 说明
GetStream()

获取 Stream

适用于