Reputation: 4537
I have created a solution with two database projects: Dependent.sqlproj and Dependency.sqlproj. The Dependent.sqlproj references to Dependency.sqlproj:
<ItemGroup>
<SqlCmdVariable Include="Dependency">
<DefaultValue>Dependency</DefaultValue>
<Value>$(SqlCmdVar__4)</Value>
</SqlCmdVariable>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Dependency\Dependency.sqlproj">
<Name>Dependency</Name>
<Project>{d635d16a-0d11-4c0a-b4c3-a646e442d8f4}</Project>
<Private>True</Private>
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
<DatabaseSqlCmdVariable>Dependency</DatabaseSqlCmdVariable>
</ProjectReference>
</ItemGroup>
After compitation of Dependent.sqlproj the bin folder looks fine, because it contains following files:
But despite all my efforts the following command creates only Dependent
database on a target server:
sqlpackage /a:Publish ^
/sf:Dependent.dacpac ^
/tsn:"(localdb)\MSSQLLocalDB" ^
/tdn:Dependent ^
/dsp:Deployment.sql ^
/df:Deployment.log ^
/p:IncludeCompositeObjects=true ^
/v:Dependency=Dependency
Note, the Deployment.log proves the package dependency is resolved:
Microsoft.Data.Tools.Diagnostics.Tracer Information: 0 : 2021-09-12T21:33:17 : Searching for file DEPENDENCY.DACPAC using relative path ****\Dependent\bin\Debug
Microsoft.Data.Tools.Diagnostics.Tracer Information: 0 : 2021-09-12T21:33:17 : Searching for file DEPENDENCY.DACPAC in directory ****\Dependent\bin\Debug
Microsoft.Data.Tools.Diagnostics.Tracer Information: 0 : 2021-09-12T21:33:17 : Resolved file DEPENDENCY.DACPAC using path ****\Dependent\bin\Debug\Dependency.dacpac
But Deployment.sql contains nothing about Dependency
database. So, what do I do wrong?
I understand, it's possible to deploy all packages successively, but it seems the IncludeCompositeObjects
parameter should do it automatically. If not, what is the point of the parameter?
Environment
SqlPackage version is 15.0.5176.1.
SQL Server version is 13.0.4001.
Upvotes: 1
Views: 387