DacPackageExtensions.BuildPackage Method (Stream, TSqlModel, PackageMetadata, PackageOptions)
Creates a package with the specified TSqlModel and saves it to the specified Stream. In addition to the TSqlModel, other artifacts such as refactor log and deployment contributors can be specified in packageOptions.
Namespace: Microsoft.SqlServer.Dac
Assembly: Microsoft.SqlServer.Dac.Extensions (in Microsoft.SqlServer.Dac.Extensions.dll)
Syntax
'Declaration
Public Shared Sub BuildPackage ( _
stream As Stream, _
model As TSqlModel, _
packageMetadata As PackageMetadata, _
packageOptions As PackageOptions _
)
'Usage
Dim stream As Stream
Dim model As TSqlModel
Dim packageMetadata As PackageMetadata
Dim packageOptions As PackageOptions
DacPackageExtensions.BuildPackage(stream, model, _
packageMetadata, packageOptions)
public static void BuildPackage(
Stream stream,
TSqlModel model,
PackageMetadata packageMetadata,
PackageOptions packageOptions
)
public:
static void BuildPackage(
Stream^ stream,
TSqlModel^ model,
PackageMetadata^ packageMetadata,
PackageOptions^ packageOptions
)
static member BuildPackage :
stream:Stream *
model:TSqlModel *
packageMetadata:PackageMetadata *
packageOptions:PackageOptions -> unit
public static function BuildPackage(
stream : Stream,
model : TSqlModel,
packageMetadata : PackageMetadata,
packageOptions : PackageOptions
)
Parameters
- stream
Type: System.IO.Stream
Stream to which the package content will be serialized.
- model
Type: Microsoft.SqlServer.Dac.Model.TSqlModel
TSqlModel representing the model to save into the package.
- packageMetadata
Type: Microsoft.SqlServer.Dac.PackageMetadata
Metadata information that describes the package.
- packageOptions
Type: Microsoft.SqlServer.Dac.PackageOptions
PackageOptions defining advanced options and additional artifacts.
Exceptions
Exception | Condition |
---|---|
DacServicesException | If there are any errors during package serialization, including errors validating the model. |
ArgumentNullException | If the stream or model parameters are null. |