microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.51k stars 883 forks source link

cant find 'master.dacpac' with Microsoft.Build.Sql v 0.1.15-preview #25517

Open waylew-abc opened 4 months ago

waylew-abc commented 4 months ago

Steps to Reproduce:

  1. in database project file update sdk Microsoft.Build.Sql from 0.1.14-preview to 0.1.15-preview
  2. publish project to local database

Did this occur in prior versions? If not - which version(s) did it work in? this worked in prior versions

updating to latest dacpac did not help

160.2.1 True master Note: this seems to only fail on windows, we have an automation pipeline that uses linux which does not have this issue. (DacFx/SqlPackage/SSMS/Azure Data Studio)
zijchen commented 4 months ago

How are you adding the reference to master.dacpac? Do you see the master.dacpac in your output folder when you build?

waylew-abc commented 4 months ago

I never had to do that in previous versions. I assumed, that since its a nuget, it would download the dacpac during the dotnet restore call, has this changed with 0.15?

160.2.1 True master

From: Z Chen @.> Sent: Thursday, March 14, 2024 1:27 PM To: microsoft/DacFx @.> Cc: Wayne Lewalski @.>; Author @.> Subject: [EXTERNAL] Re: [microsoft/DacFx] cant find 'master.dacpac' with Microsoft.Build.Sql v 0.1.15-preview (Issue microsoft/azuredatastudio#25517)

How are you adding the reference to master.dacpac? Do you see the master.dacpac in your output folder when you build?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/azuredatastudio/issues/25517, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3NPZLIIT62RKKPHMRFZKPTYYHMZ7AVCNFSM6AAAAABEUWSSVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJXHE3TIOBWGU. You are receiving this because you authored the thread.

zijchen commented 4 months ago

Nothing changed with PackageReference and your reference there looks good. May I ask how you are publishing to your local environment? Are you using sqlpackage or some other tool?

This could be caused by the change for microsoft/DacFx#329, we removed the full path to master.dacpac from the build output. During publish, DacFx will assume the path written to model.xml to be relative. Do you see master.dacpac in your output folder? What does the path look like if you look for the master.dacpac in obj/model.xml?

waylew-abc commented 4 months ago

I am using publish via Azure Data Studio via the SQL Database Projects extsion v1.4.2

I do see the .dacpac within the bin/Debug folder


From: Z Chen @.> Sent: Monday, March 18, 2024 1:09 PM To: microsoft/DacFx @.> Cc: Wayne Lewalski @.>; Author @.> Subject: [EXTERNAL] Re: [microsoft/DacFx] cant find 'master.dacpac' with Microsoft.Build.Sql v 0.1.15-preview (Issue microsoft/azuredatastudio#25517)

Nothing changed with PackageReference and your reference there looks good. May I ask how you are publishing to your local environment? Are you using sqlpackage or some other tool?

This could be caused by the change for microsoft/DacFx#329https://github.com/microsoft/DacFx/issues/329, we removed the full path to master.dacpac from the build output. During publish, DacFx will assume the path written to model.xml to be relative. Do you see master.dacpac in your output folder? What does the path look like if you look for the master.dacpac in obj/model.xml?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/azuredatastudio/issues/25517, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3NPZLKNSLVFGAY2BSPFFR3YY4NVLAVCNFSM6AAAAABEUWSSVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBUGQ4DENJZGM. You are receiving this because you authored the thread.

zijchen commented 4 months ago

Thanks for sharing that info. I can reproduce the issue now. The issue is in this line of ADS: https://github.com/microsoft/azuredatastudio/blob/97d1a9f3e90cec5dd756056c533b6a448058f9cd/extensions/sql-database-projects/src/controllers/projectController.ts#L544

It copies the dacpac to a temp location before publish, but with changes in microsoft/DacFx#329, the master.dacpac also need to copied. I'll transfer this issue to ADS repo and send a fix soon.