Scope analyzer PackageReferences to SDK-style projects only in Directory.Build.props#60
Merged
Chris-Wolfgang merged 2 commits intorepofrom Mar 9, 2026
Merged
Scope analyzer PackageReferences to SDK-style projects only in Directory.Build.props#60Chris-Wolfgang merged 2 commits intorepofrom
Chris-Wolfgang merged 2 commits intorepofrom
Conversation
Co-authored-by: Chris-Wolfgang <210299580+Chris-Wolfgang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback on standardized repo files from repo-template
Scope analyzer PackageReferences to SDK-style projects only in Directory.Build.props
Mar 9, 2026
Chris-Wolfgang
approved these changes
Mar 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Scopes globally injected analyzer PackageReference items in Directory.Build.props so they only apply to SDK-style projects, preventing restore issues for legacy packages.config projects under examples/Net4.8.
Changes:
- Added
Condition="'$(UsingMicrosoftNETSdk)' == 'true'"to theAdditionalFilesItemGroup. - Added the same condition to the analyzer
PackageReferenceItemGroup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Directory.Build.propswas injecting analyzerPackageReferenceitems into all projects globally, including legacy non-SDK.csprojfiles inexamples/Net4.8that usepackages.config, breaking restore behavior for those projects.Description
Added
Condition="'$(UsingMicrosoftNETSdk)' == 'true'"to bothItemGroupblocks so analyzer references are only applied to SDK-style projects:Legacy
packages.configprojects (e.g.,examples/Net4.8/**) are unaffected.Type of change
How Has This Been Tested?
Directory.Build.propsno longer injectsPackageReferenceitems into non-SDK projectsChecklist
Screenshots (if applicable)
Additional context
Addresses feedback from #58.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.