Skip to content

Emit DacFx and Database Reference Versions in Build Output #614

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

Open
jasonhorner opened this issue Apr 22, 2025 · 4 comments
Open

Emit DacFx and Database Reference Versions in Build Output #614

jasonhorner opened this issue Apr 22, 2025 · 4 comments
Labels
dacfx.projects Related to dacfx.projects library for sqlproj

Comments

@jasonhorner
Copy link

✨ Feature Request: Output DacFx and Database Reference Versions
Is your feature request related to a problem? Please describe.

I'm always frustrated when trying to troubleshoot database builds or deployments using dotnet build or sqlpackage, and I can't easily determine which version of DacFx or database references (e.g., master.dacpac) were actually used during the process. This makes it difficult to identify version mismatches across environments or diagnose issues with builds and deployments.

Describe the solution you'd like

I would like dotnet build (when building SDK-style .sqlproj) and sqlpackage (for deployment or script generation) to include the following in the standard output:

The version of Microsoft.SqlServer.DacFx being used (e.g., 170.0.94.3)
Possibly the version of Microsoft.Build.Sql

The versions of any referenced DACPACs (e.g., Microsoft.SqlServer.Dacpacs.Azure.Master v160.2.4)

This information could be printed by default or behind an optional verbosity flag (/v:normal or /v:detailed), and would dramatically improve traceability and troubleshooting.

Example:

DacFx version: 170.0.94.3
Reference: Microsoft.SqlServer.Dacpacs.Azure.Master v160.2.4

Describe alternatives you've considered

Note sure how else to get this information open to suggestions
I would expect this to end up in one of the build artifacts but wasn't able to find it

Additional context
This would be especially helpful in DevOps pipelines or Fabric deployments where validation of toolchain versions is critical. It would also help differentiate between breaking changes caused by SDK upgrades versus other deployment logic.

@ErikEJ
Copy link
Contributor

ErikEJ commented Apr 22, 2025

@jasonhorner I will add this proposal to our MsBuild.Sdk:SqlProj project!

btw - sqlpackage already has a "version"

@jasonhorner
Copy link
Author

@ErikEJ yes

sqlpackage.exe /version

outputs the version however when you run a sqlpackage command such as

sqlpackage /Action:Script

There doesn't appear to be a way to determine the version that was called. This is probably a more minor issue. but useful as I struggled after I had updated sqlpackage (DacFx) locally. The script generated by the SQL project extension (via Publish → Generate Script) differed from the one produced by running sqlpackage from the command line. Being able to easily verify the DacFx version in use would have saved time and reduced confusion.

@ErikEJ
Copy link
Contributor

ErikEJ commented Apr 22, 2025

Maybe a version number in the script would be more useful? The VS DacFX version used in very well hidden.

@jasonhorner
Copy link
Author

Perhaps, to be honest it's all a bit confusing to figure out how it all fits together and figure out if the issue is in the sqlproject extension, SqlPackage or build.sql or the underlying DacfX.. Every time I dig in it makes a bit more sense.

@llali llali added the dacfx.projects Related to dacfx.projects library for sqlproj label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dacfx.projects Related to dacfx.projects library for sqlproj
Projects
None yet
Development

No branches or pull requests

3 participants