This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see
Cake.SqlServer .
Summary
Publish a dacpac file to a database.
Syntax
public static void PublishDacpacFile ( this ICakeContext context, string connectionString, string targetDatabaseName, FilePath dacpacFilePath, PublishDacpacSettings settings = null )
Examples
#addin "nuget:?package=Cake.SqlServer"
Task("Create-Bacpac" )
.Does(() =>{
var connString = @"data source=(localdb)\MSSqlLocalDb" ;
var dbName = "ForDacpac" ;
var file = new FilePath(@".\src\Tests\TestData\Nsaga.dacpac" );
var settings = new PublishDacpacSettings {
GenerateDeploymentScript = true
};
PublishDacpacFile(connString, dbName, file, settings);
});
});
Attributes
Type
Description
CakeMethodAliasAttribute
Parameters
Name
Type
Description
context
ICakeContext
The Cake context.
connectionString
string
The connection string. You may want to connect to master database for this operation.
targetDatabaseName
string
Name of a target database.
dacpacFilePath
FilePath
Full path to the dacpac file.
settings
PublishDacpacSettings
Configure the sql deployment
Return Value