MSBuild.Sdk.SqlProj icon indicating copy to clipboard operation
MSBuild.Sdk.SqlProj copied to clipboard

2nd order dependencies

Open verquepasa opened this issue 3 years ago • 2 comments

I managed to include master dacpac as reference by packing it into a nupkg and adding them as references to my project (let's call it Core) , I packed Core into a nupkg and got master.dacpac into its /tools directory and referenced in the nuspec file.

Core.nupkg is itself a reference in another project (let's call it Test.csproj ), but building fails because it can not find the master objects. If I include master.nupkg directly into Test.csproj, it works.

Thanks again for the project!

verquepasa avatar Jun 10 '21 15:06 verquepasa

Yes, I can understand why this works as you describe. We don't currently traverse the entire dependency tree, but only the direct PackageReference's of the project and include those .dacpac's during the build phase. I guess I can understand why someone would expect this to behave like you described since that is what happens in regular .NET projects.

That being said I'm not even sure we're able to figure out the dependency tree at the place we would need this. I guess this could be investigated, but I'd rather not re-invent the wheel here.

@ErikEJ @jeffrosenberg Any thoughts on this?

jmezach avatar Jun 13 '21 17:06 jmezach

For EF Core Power Tools, I attempt to resolve all .dacpac references: https://github.com/ErikEJ/EFCorePowerTools/blob/master/src/GUI/ErikEJ.EntityFrameworkCore.SqlServer.Dacpac/DacpacConsolidate/DacpacConsolidator.cs#L28 - but starting to do that always can be very brittle in my experience.

ErikEJ avatar Jun 14 '21 06:06 ErikEJ

Not planned, and there is an easy workaround

ErikEJ avatar Nov 22 '22 14:11 ErikEJ