Package.EnableConfigurations 속성

정의

패키지에서 구성을 로드하는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool EnableConfigurations { bool get(); void set(bool value); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "EnableConfigurationsDesc")]
public bool EnableConfigurations { get; set; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "EnableConfigurationsDesc")>]
member this.EnableConfigurations : bool with get, set
Public Property EnableConfigurations As Boolean

속성 값

Boolean

패키지가 구성을 로드하는 경우 true입니다. 그렇지 않으면 false입니다.

특성

예제

다음 예제에서는 새 패키지를 만든 다음 EnableConfigurations 속성을 설정 합니다trueExportConfigurationFile. 그런 다음 패키지에 새 구성을 추가하고 여러 속성의 값을 설정합니다.

Package pkg = new Package();  
pkg.EnableConfigurations = true;  
pkg.ExportConfigurationFile("conf.xml");  
// Create a variable object and add it to the   
// package Variables collection.  
Variable varPkg = pkg.Variables.Add("var", false, "", 100);  
varPkg.Value = 1;  
string packagePathToVariable = varPkg.GetPackagePath();  

Configuration config = pkg.Configurations.Add();  
config.ConfigurationString = "conf.xml";  
config.ConfigurationType = DTSConfigurationType.ConfigFile;  
config.PackagePath = packagePathToVariable;  
// more code here.  
Dim pkg As Package =  New Package()   
pkg.EnableConfigurations = True  
pkg.ExportConfigurationFile("conf.xml")  
' Create a variable object and add it to the   
' package Variables collection.  
Dim varPkg As Variable =  pkg.Variables.Add("var",False,"",100)   
varPkg.Value = 1  
Dim packagePathToVariable As String =  varPkg.GetPackagePath()   

Dim config As Configuration =  pkg.Configurations.Add()   
config.ConfigurationString = "conf.xml"  
config.ConfigurationType = DTSConfigurationType.ConfigFile  
config.PackagePath = packagePathToVariable  
' more code here.  

설명

이 속성을 설정 false하면 로드된 구성에서 덮어쓰지 않고 패키지의 지속형 값이 사용됩니다.

패키지를 배포할 때 마지막 구성으로 false 설정할 수 있습니다. 그런 다음 배포 후 패키지를 처음 실행하면 구성 값으로 패키지 값을 한 번 덮어씁니다. 패키지에서 사용하는 구성에 대한 자세한 내용은 패키지 구성 만들기를 참조하세요.

적용 대상