Skip to content

Fix Package Requirements for Nuget Core Package#3620

Merged
RubenCerna2079 merged 9 commits into
mainfrom
dev/rubencerna/fix-nuget-auth-packages
May 22, 2026
Merged

Fix Package Requirements for Nuget Core Package#3620
RubenCerna2079 merged 9 commits into
mainfrom
dev/rubencerna/fix-nuget-auth-packages

Conversation

@RubenCerna2079
Copy link
Copy Markdown
Contributor

Why make this change?

What is this change?

This adds TargetsForTfmSpecificContentInPackage and IncludeInternalDependenciesInPackage to create the dependencies from the Core project as dlls. And uses the PrivateAssets to ensure that those dependencies are not added to the nuspec file.

How was this tested?

  • Integration Tests
  • Unit Tests
  • Manual Tests
    Tested by using command dotnet pack .\Azure.DataApiBuilder.Core.csproj -c Release to build nuget package and ensure that all the dependencies are created as expected.
image

Sample Request(s)

N/A

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Core NuGet packaging logic so the Microsoft.DataApiBuilder.Core package includes internal dependency assemblies during dotnet pack, addressing a broken Core package that previously omitted required DLLs.

Changes:

  • Adds a custom pack target (IncludeInternalDependenciesInPackage) and wires it into TargetsForTfmSpecificContentInPackage.
  • Marks Core’s internal ProjectReferences as PrivateAssets="all" to avoid emitting them as NuGet dependencies.
  • Packs reference assemblies into lib/<tfm> via TfmSpecificPackageFile.
Comments suppressed due to low confidence (2)

src/Core/Azure.DataApiBuilder.Core.csproj:74

  • The target is including all @(ReferenceCopyLocalPaths) into the package. That typically includes copy-local assemblies from NuGet package references as well as project references, which can massively bloat the nupkg and create assembly version/conflict risks (and may have licensing/NOTICE implications). If the goal is only to embed internal project-reference outputs (Auth/Config/GraphQLBuilder), filter the item list to those (e.g., by metadata indicating project references or by limiting to the referenced projects’ output paths/assembly names).
  <Target Name="IncludeInternalDependenciesInPackage">
      <ItemGroup>
        <TfmSpecificPackageFile Include="@(ReferenceCopyLocalPaths)" PackagePath="lib/$(TargetFramework)" Condition="'%(ReferenceCopyLocalPaths.Extension)' != '.pdb'" />
    </ItemGroup>

src/Core/Azure.DataApiBuilder.Core.csproj:75

  • Indentation within the new <Target> block is inconsistent (extra indentation before <ItemGroup> and misaligned closing tag), which can make future edits/error spotting harder. Please align indentation with the rest of the project file.
  <Target Name="IncludeInternalDependenciesInPackage">
      <ItemGroup>
        <TfmSpecificPackageFile Include="@(ReferenceCopyLocalPaths)" PackagePath="lib/$(TargetFramework)" Condition="'%(ReferenceCopyLocalPaths.Extension)' != '.pdb'" />
    </ItemGroup>
  </Target>

Comment thread src/Core/Azure.DataApiBuilder.Core.csproj Outdated
@Aniruddh25 Aniruddh25 assigned Aniruddh25 and unassigned anushakolan May 21, 2026
Copy link
Copy Markdown
Contributor

@aaronburtle aaronburtle left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment thread src/Core/Azure.DataApiBuilder.Core.csproj
@RubenCerna2079 RubenCerna2079 merged commit 4d92d12 into main May 22, 2026
12 checks passed
@RubenCerna2079 RubenCerna2079 deleted the dev/rubencerna/fix-nuget-auth-packages branch May 22, 2026 20:56
@github-project-automation github-project-automation Bot moved this from Todo to Done in Data API builder May 22, 2026
RubenCerna2079 added a commit that referenced this pull request May 22, 2026
## Why make this change?

- Solves issue #3618

## What is this change?

This adds `TargetsForTfmSpecificContentInPackage` and
`IncludeInternalDependenciesInPackage` to create the dependencies from
the Core project as dlls. And uses the `PrivateAssets` to ensure that
those dependencies are not added to the nuspec file.

## How was this tested?

- [ ] Integration Tests
- [ ] Unit Tests
- [X] Manual Tests
Tested by using command `dotnet pack .\Azure.DataApiBuilder.Core.csproj
-c Release` to build nuget package and ensure that all the dependencies
are created as expected.

<img width="828" height="355" alt="image"
src="https://github.com/user-attachments/assets/cb3a72c1-1984-4869-aece-4f1d17bc7519"
/>

## Sample Request(s)

N/A

---------

Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
Aniruddh25 added a commit that referenced this pull request May 22, 2026
## Why make this change?

This change cherry-picks the PRs that fixes the new Nuget Core Package

## What is this change?

Cherry-picked PRs

- #3617
- #3620

## How was this tested?

Existing tests in cherry-pick cover new changes.

## Sample Request(s)

N/A

---------

Co-authored-by: aaronburtle <93220300+aaronburtle@users.noreply.github.com>
Co-authored-by: Aniruddh Munde <anmunde@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix Core.csproj Package Requirements

5 participants