I am trying to deploy a database project (dbproj format, not the new sqlproj SSDT) inside the automatic processing of the build server. I found the following:
When I call the deployment with the Exec task in my Msbuild script - everything works fine:
<Exec Command="$(MSBuildPath)\MSBuild.exe $(SourceFilesPath)\$(DeployDatabaseProjectName)\$(DeployDatabaseProjectName).dbproj
/t:Deploy
/p:OutputPath=$(BaseOutput)\$(DeployDatabaseProjectName)\
/p:TargetDatabase=$(DeployDatabaseName)
/p:TargetConnectionString=$(DeployDatabaseConnectionString)" />
But when I try to repeat this using the Msbuild task, it behaves differently:
<MSBuild Projects="$(SourceFilesPath)\$(DeployDatabaseProjectName)\$(DeployDatabaseProjectName).dbproj"
Targets="Deploy"
Properties="Configuration=$(BuildConfiguration);
TargetDatabase=$(DeployDatabaseName);
TargetConnectionString="$(DeployDatabaseConnectionString)";
OutputPath=$(BaseOutput)\$(DeployDatabaseProjectName)\;
" />
The Msbuild task broke into semicolons in DeployDatabaseConnectionString:
<DeployDatabaseConnectionString>Data Source=$(DeployDatabaseServer);Integrated Security=True;Pooling=False</DeployDatabaseConnectionString>
He will report the following:
The name "Integrated Security" contains an invalid character " .
But if I replace the semicolon with the percentage value of the encoding -% 3B - it will be broken inside SqlDeployTask:
error MSB4018: The SqlDeployTask task unexpectedly failed.
TargetConnectionString SqlProject?
PS: exec, msbuild.exe msbuild script -.