Move shared package references to Directory.Build.props#14
Conversation
Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
seesharprun
left a comment
There was a problem hiding this comment.
I only want to put shared components in the Directory.Build.props file. For example, this is the only sample that would use Azure.Identity. If a library is only used in one sample, it should be embedded in the C# script file. If it's used in more than one sample, it's in the Directory.Build.props file.
Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
Updated in ec85b13. |
seesharprun
left a comment
There was a problem hiding this comment.
This is wrong.
Microsoft.Azure.Cosmos, Newtonsoft.Json should be in the props file. Only Azure.Identity should be in the script file.
…y.Build.props Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
Fixed in a0f1caf. |
There was a problem hiding this comment.
Pull request overview
This PR centralizes common NuGet dependencies for the .NET samples by moving shared package references into dotnet/Directory.Build.props, while keeping sample-specific dependencies declared inline in the script.
Changes:
- Added
PackageReferenceentries for Cosmos SDK, UserSecrets, and Newtonsoft.Json todotnet/Directory.Build.props(versions resolved viadotnet/Directory.Packages.props). - Removed the corresponding
#:packagedirectives fromdotnet/001-connect-passwordless/connect.cs, leaving onlyAzure.Identityas an inline directive.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dotnet/Directory.Build.props | Adds global PackageReference entries intended to be inherited by .NET samples under dotnet/. |
| dotnet/001-connect-passwordless/connect.cs | Removes inline package directives for packages now referenced via shared MSBuild props. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Only packages shared across all samples belong in
Directory.Build.props. MovingMicrosoft.Azure.Cosmos,Newtonsoft.Json, andMicrosoft.Extensions.Configuration.UserSecretsthere keeps them inherited by all projects, while sample-specific packages remain as#:packagedirectives in the script file.Changes
Directory.Build.props— Added<ItemGroup>withPackageReferenceentries forMicrosoft.Azure.Cosmos,Microsoft.Extensions.Configuration.UserSecrets, andNewtonsoft.Json(shared across samples; no versions specified, resolved via centralDirectory.Packages.props)connect.cs— Removed#:packagedirectives for the shared packages; only#:package Azure.Identityremains as it is specific to this sampleBefore (
connect.cs)After (
connect.cs)💡 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.