Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove checked-in nuspec files to resolve build issues#37826

Open
Copilot wants to merge 12 commits intomainfrom
copilot/remove-checked-in-nuspec-files
Open

Remove checked-in nuspec files to resolve build issues#37826
Copilot wants to merge 12 commits intomainfrom
copilot/remove-checked-in-nuspec-files

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

Fixes #36254
Fixes #33165

Removes checked-in .nuspec files for dotnet-ef, EFCore.Tools, and EFCore.Tasks and replaces them with MSBuild properties and _PackageFiles targets. This fixes build breaks with newer SDKs where the nuspec files cause NU5000 errors due to missing package type name attributes.

Changes Made

  • Removed src/dotnet-ef/dotnet-ef.nuspec, src/EFCore.Tools/EFCore.Tools.nuspec, src/EFCore.Tasks/EFCore.Tasks.nuspec
  • dotnet-ef.csproj: Replaced NuspecFile/SetPackageProperties with an AddEfProjectOutput target that uses _PackageFiles to include ef.csproj output (dll, exe, pdb, runtimeconfig) at the correct package paths. An ExcludePdbFiles target strips all PDB files from the main package; they are included only in the symbols package
  • EFCore.Tools.csproj: Replaced NuspecFile/SetPackageProperties with an AddPackContent target for lib, tools, psd1, and ef.csproj output (including PDB files). An ExcludePdbFiles target strips PDBs from the main package. Added Microsoft.EntityFrameworkCore.Design as a PackageReference with VersionOverride="8.0.0" for the dependency declaration
  • EFCore.Tasks.csproj: Replaced NuspecFile/SetPackageProperties with an AddPackContent target for lib, tasks, tools, and buildTransitive content. Added a ProjectReference to EFCore.Design with PrivateAssets="all" (for build ordering) and a separate PackageReference with VersionOverride="10.0.0" for the nuspec dependency. Set SuppressDependenciesWhenPacking=true for net472 and Pack=false on .NET Framework References to suppress unwanted dependency groups. Added lib/net10.0/_._ marker file to ensure the package is recognized as targeting net10. ExcludePdbFiles target and eng/CreateSymbolsPackage.targets import for symbols package creation
  • Renamed all PACKAGE.md files to README.md across src/ and test/ directories (22 files) and updated Directory.Build.targets to auto-detect README.md instead of PACKAGE.md
  • eng/CreateSymbolsPackage.targets: Added a shared MSBuild targets file that creates the .symbols.nupkg via a second MSBuild Pack call with _IsSymbolsPack=true. PDB files are included unconditionally in _PackageFiles, and each project has an ExcludePdbFiles target that strips all .pdb files by extension when _IsSymbolsPack != true. This ensures the main package nuspec is generated without PDB references, while the symbols package includes them correctly. Uses $([MSBuild]::NormalizeDirectory(...)) for cross-platform path handling. Imported by dotnet-ef.csproj, EFCore.Tools.csproj, and EFCore.Tasks.csproj
  • EFCore.Analyzers.csproj: Removed explicit PackageReadmeFile property (auto-detected by Directory.Build.targets)
  • Cross-platform paths: All _PackageFiles Include attributes use / instead of \ for filesystem paths to ensure compatibility on non-Windows builds

Package Content Comparison

Package contents were compared before and after the change. Remaining differences are expected SDK behavior changes:

  • README.md location: Package readme now included as README.md at the package root (previously docs/PACKAGE.md)
  • dotnet-ef AppHost: Native dotnet-ef binary no longer in package (SDK explicitly removes AppHost for RID-neutral tool packages per Microsoft.NET.PackTool.targets)
  • Nuspec metadata: exclude="Build,Analyzers" added by SDK on Design dependency (default for PackageReferences); empty .NETFramework4.7.2 dependency group in Tasks (functionally identical to no group)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 2, 2026 22:10
- Remove dotnet-ef.nuspec, EFCore.Tools.nuspec, EFCore.Tasks.nuspec
- Convert package customizations to MSBuild properties and targets
- Add Microsoft.EntityFrameworkCore.Design to Directory.Packages.props
- Use _PackageFiles items in targets to include ef project outputs
- Add PrivateAssets="all" to ef ProjectReference to prevent dependency leakage
- Use ProjectReference to EFCore.Design for Tasks dependency

Co-authored-by: AndriySvyryd <[email protected]>
@AndriySvyryd
Copy link
Member

@copilot To validate, compare the content of the affected NuGet before and after the fix, they should match exactly, however, it's acceptable if the versions change to 11.0.0-dev or 11.0.0-dev 3

…ks, add Pack=false to framework refs

Co-authored-by: AndriySvyryd <[email protected]>
Copy link
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot To validate, compare the content of the affected NuGet before and after the fix, they should match exactly, however, it's acceptable if the versions change to 11.0.0-dev or ...

Validated in commit ccbce7a. Comparison summary:

EFCore.Tasks — only PACKAGE.md location change (docs/ → root, new NuGet SDK standard).

EFCore.ToolsPACKAGE.md location + ef.pdb files now also in main package (old nuspec with IncludeSymbols redirected PDBs to symbols-only).

dotnet-efPACKAGE.md location + dotnet-ef native AppHost removed (SDK explicitly removes it for RID-neutral tool packages in Microsoft.NET.PackTool.targets L202) + dotnet-ef.pdb from publish dir + ef.pdb files in main package.

Nuspec metadataexclude="Build,Analyzers" added by SDK default on Design dependency; empty <group targetFramework=".NETFramework4.7.2" /> in Tasks (functionally identical to no group); branch attribute on <repository> (CI artifact). All versions are 11.0.0-dev as expected.

Copilot AI changed the title [WIP] Remove checked-in nuspec files to resolve build issues Remove checked-in nuspec files to resolve build issues Mar 2, 2026
@AndriySvyryd
Copy link
Member

@copilot Rename every PACKAGE.md to README.md

Copy link
Contributor Author

Copilot AI commented Mar 2, 2026

@copilot Rename every PACKAGE.md to README.md

Done in b22182a. Renamed all 22 PACKAGE.md files to README.md and updated Directory.Build.targets to auto-detect README.md instead of PACKAGE.md.

@AndriySvyryd AndriySvyryd requested a review from Copilot March 3, 2026 00:40
Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

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

@copilot Update description with a nice summary of the changes

…, simplify PDB handling, add lib/_._

Co-authored-by: AndriySvyryd <[email protected]>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot Update description with a nice summary of the changes

Updated in the PR description checklist. Note: I can only update the description through the report_progress tool, which uses a checklist format. If you need a different format for the final description, please update it directly.

@AndriySvyryd
Copy link
Member

@copilot Update PR progress with a nice summary of the changes

Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot Update PR progress with a nice summary of the changes

Done — PR description updated with a full summary covering: removed nuspec files, per-project csproj changes (AddEfProjectOutput/AddPackContent targets, ExcludePdbFiles, Design dependency handling), PACKAGE.md→README.md renames, eng/CreateSymbolsPackage.targets two-pass approach, cross-platform path fixes, and expected package content differences.

Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

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

@copilot Also remove the explicit PackageReadmeFile from EFCore.Analyzers.csproj‎

Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot Also remove the explicit PackageReadmeFile from EFCore.Analyzers.csproj‎

Fixed in 0a520ba. Removed the explicit PackageReadmeFile from EFCore.Analyzers.csproj — it's now auto-detected by Directory.Build.targets.

@AndriySvyryd AndriySvyryd marked this pull request as ready for review March 3, 2026 01:33
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner March 3, 2026 01:33
Copilot AI review requested due to automatic review settings March 3, 2026 01:33
@AndriySvyryd AndriySvyryd assigned roji and unassigned AndriySvyryd and Copilot Mar 3, 2026
Copy link

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

Copilot reviewed 9 out of 32 changed files in this pull request and generated 1 comment.

@AndriySvyryd AndriySvyryd requested a review from ViktorHofer March 3, 2026 01:47
…version to 10.0.0, remove explicit PackageReadmeFile from Analyzers

Co-authored-by: AndriySvyryd <[email protected]>
@AndriySvyryd AndriySvyryd force-pushed the copilot/remove-checked-in-nuspec-files branch from 0a520ba to b89d49d Compare March 3, 2026 02:35
Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

The CreateSymbolsPackage.targets stuff looks wrong. Nuget already handles creating symbol packages by default. Can you share more info on why this needed?

@AndriySvyryd
Copy link
Member

The default targets include the additional pdbs in the main package. This is needed to only include them in he symbols package.

@ViktorHofer
Copy link
Member

ViktorHofer commented Mar 3, 2026

For the default globs, pdbs are already filtered out automatically by NuGet when constructing the "main" package. When you add additionally stuff, you want to condition that on $(IncludeSymbols) and use the defined extension points: https://github.com/dotnet/runtime/blob/39403ad19d1eb4bb57133da1fbc57ab7099ff96a/eng/packaging.targets#L295-L300

@ViktorHofer
Copy link
Member

Btw, we should use the officially documented extension points here: https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#advanced-extension-points-to-create-customized-package. Everything else has couple of issues.

@ViktorHofer
Copy link
Member

ViktorHofer commented Mar 3, 2026

Happy to help. I hope pushing a few commits here is OK.

@AndriySvyryd
Copy link
Member

Happy to help. I hope pushing a few commits here is OK.

Please go ahead if you can get it to work.

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.

Avoid checked-in nuspec files dotnet-ef isn't packed properly on MacOS

5 participants