Skip to content

Ship Microsoft.ApplicationInsights.dll with Microsoft.Build.Sql SDK#798

Merged
llali merged 1 commit into
microsoft:mainfrom
Phantom-Sixth-Man:kumarshivam/ship-applicationinsights-with-build-sql-sdk
Jun 4, 2026
Merged

Ship Microsoft.ApplicationInsights.dll with Microsoft.Build.Sql SDK#798
llali merged 1 commit into
microsoft:mainfrom
Phantom-Sixth-Man:kumarshivam/ship-applicationinsights-with-build-sql-sdk

Conversation

@Phantom-Sixth-Man

@Phantom-Sixth-Man Phantom-Sixth-Man commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Microsoft.ApplicationInsights (2.23.0) as a runtime asset that is staged into the Microsoft.Build.Sql SDK NuGet package, so the DacFx tasks loaded by consumers can resolve Microsoft.ApplicationInsights.dll at build time using MSBuild.

Background

  • src/Microsoft.Build.Sql/Microsoft.Build.Sql.csproj builds an MSBuild SDK and sets SuppressDependenciesWhenPacking=true, so transitive NuGet dependencies are not surfaced to the sqlproj that consumes the SDK.
  • DacFx assemblies hosted by the SDK reference Microsoft.ApplicationInsights. Without explicitly staging the assembly, consumer builds rely on transitive resolution that is not guaranteed in every host.

Changes

  • Added central PackageVersion for Microsoft.ApplicationInsights 2.23.0 in Directory.Packages.props.
  • Added a PackageReference (with GeneratePathProperty="true") in src/Microsoft.Build.Sql/Microsoft.Build.Sql.csproj.
  • Staged Microsoft.ApplicationInsights.dll into both tools/net8.0/ (from lib/netstandard2.0) and tools/net472/ (from lib/net46).

Backward Compatibility

  • No public API or SDK contract changes.
  • No action required from customers.

Code Changes

  • Unit tests are added, if possible - N/A (no behavior change; existing build/pack/publish/template tests pass on net8.0).
  • Existing tests are passing (dotnet test on Microsoft.Build.Sql.Tests net8.0: 72/72 passed).
  • New or updated code follows the guidelines here.
  • Ensure .dacpac from changes to Microsoft.Build.Sql build process MUST be backwards compatible with older versions of SqlPackage.
  • Use proper logging for MSBuild tasks (no logging surface changes).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Microsoft.Build.Sql MSBuild SDK packaging process to ensure Microsoft.ApplicationInsights.dll is staged into the SDK’s NuGet tools/ assets, so DacFx tasks can resolve it at build time even when transitive dependencies are suppressed.

Changes:

  • Adds central package version pin for Microsoft.ApplicationInsights (2.23.0).
  • Adds a PackageReference with GeneratePathProperty="true" to enable staging from the restored package.
  • Copies Microsoft.ApplicationInsights.dll into the SDK staging output for both net8.0 and net472.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Microsoft.Build.Sql/Microsoft.Build.Sql.csproj Adds ApplicationInsights package reference and stages the DLL into the SDK’s tools/ output for net8.0 and net472.
Directory.Packages.props Pins Microsoft.ApplicationInsights to 2.23.0 via central package management.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Microsoft.Build.Sql/Microsoft.Build.Sql.csproj
Comment thread src/Microsoft.Build.Sql/Microsoft.Build.Sql.csproj
@llali llali merged commit 06209ca into microsoft:main Jun 4, 2026
12 checks passed
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

Successfully merging this pull request may close these issues.

3 participants