Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transitive references treated as though it's part of the top level project #359

Open
wilstoff opened this issue Nov 14, 2022 · 2 comments
Open

Comments

@wilstoff
Copy link
Contributor

wilstoff commented Nov 14, 2022

While I may have caused this in #329, i'm not really seeing it currently.

The behavior is as such:

Project A depends on nothing has User MyUser in its schema
Project B depends on A as a DatabaseLiteralValue
Project C depends on B as linked server passing both DatabaseSqlCmdVariable and ServerSqlCmdVariable
Project C also has a User MyUser in its schema

When i build a project like this i get errors saying

The Model already has an element that has the same name MyUser

I believe this is because when building C, project A is passed into the DacpacTool.dll as a reference with no parameters

-r "ProjectA;dbl=|dbv=|srv=;"

Which then i believe the build tool treats it as a reference meant to be apart of this project instead a separate server dependency.
I think there needs to be a way to treat multi layer dependencies different than just walking the tree of dependencies and removing dbl/dbv/srv. I understand the reason to remove dbl, because Project A is most likely no longer a literal local db server reference anymore (relative to C), but Project A in this case is definitely not a complete subset of C, even though it may have similar users and share some tables.

@wilstoff wilstoff changed the title Transitive references treated as though its part of the top level project Transitive references treated as though it's part of the top level project Nov 15, 2022
@nholland20
Copy link

Did you ever find a way to work around this? I am having the same issue.

@wilstoff
Copy link
Contributor Author

wilstoff commented Aug 23, 2023

We did find a work around, I'd have to go look again, but i believe just adding your full dependency chain to the list of projects seems to be where we ended up. So if C depends on B depends on A, then the workaround is to have C depend on B and A directly. That is at least what i recall. Can confirm more tomorrow..

Yea confirmed it was hacked by directly referencing implied dependencies in the top level instead of relying on dependency of dependency. It then understood the duplication. We also have some SuppressMissingDependenciesErrors="True" for a few of these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants