You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create these files with the same contents: Sql1/Table1.sql, Sql2/Table1.sql, Sql3/Table1.sql
CREATE TABLE Table1 (Id INT);
GO
Issue demonstration
dotnet build Sql3/Sql3.sqlproj fails with:
Sql1 succeeded (3.0s) → Sql1/bin/Debug/Sql1.dacpac
Sql2 succeeded (1.6s) → Sql2/bin/Debug/Sql2.dacpac
Sql3 failed with 2 error(s) (0.3s)
/Users/toby.miller/tmp/dacfx_transitive2/Sql3/Table1.sql(1,22,1,22): Build error SQL71508: The model already has an element that has the same name dbo.Table1.Id.
/Users/toby.miller/tmp/dacfx_transitive2/Sql3/Table1.sql(1,1,1,1): Build error SQL71508: The model already has an element that has the same name dbo.Table1.
But if you add the previously-indirect dependency as a direct dependency in Sql3/Sql3.sqlproj:
Each sqlproj in this case is meant to represent a different database, and the ProjectReferences indicate this. Direct dependencies correctly don't encounter collisions, but indirect dependencies can encounter collisions even though they aren't intended to be in the same database as the target.
We have a workaround, which is to specify all transitive dependencies as direct dependencies in all projects, and give them their corresponding database name variables. But this is unwieldy and difficult to maintain with many database dependencies.
The text was updated successfully, but these errors were encountered:
(DacFx/SqlPackage/SSMS/Azure Data Studio)
Setup
update
Sql2/Sql2.sqlproj
adding:update
Sql3/Sql3.sqlproj
addingCreate these files with the same contents:
Sql1/Table1.sql
,Sql2/Table1.sql
,Sql3/Table1.sql
Issue demonstration
dotnet build Sql3/Sql3.sqlproj
fails with:But if you add the previously-indirect dependency as a direct dependency in
Sql3/Sql3.sqlproj
:then
dotnet build Sql3/Sql3.sqlproj
passes.I would expect it to pass in both cases.
Comment
Each sqlproj in this case is meant to represent a different database, and the
ProjectReference
s indicate this. Direct dependencies correctly don't encounter collisions, but indirect dependencies can encounter collisions even though they aren't intended to be in the same database as the target.We have a workaround, which is to specify all transitive dependencies as direct dependencies in all projects, and give them their corresponding database name variables. But this is unwieldy and difficult to maintain with many database dependencies.
The text was updated successfully, but these errors were encountered: