.Net: Add ReferenceTrimmer and remove unused references - #13557
Closed
dfederm wants to merge 1 commit into
Closed
Conversation
dfederm
force-pushed
the
feature/reference-trimmer
branch
from
February 17, 2026 11:00
a973231 to
4ca3396
Compare
dfederm
had a problem deploying
to
integration
February 17, 2026 11:01 — with
GitHub Actions
Failure
dfederm
force-pushed
the
feature/reference-trimmer
branch
from
February 17, 2026 11:19
4ca3396 to
2d4efe4
Compare
dfederm
had a problem deploying
to
integration
February 17, 2026 11:19 — with
GitHub Actions
Failure
dfederm
marked this pull request as draft
February 17, 2026 11:27
dfederm
force-pushed
the
feature/reference-trimmer
branch
from
February 17, 2026 19:17
2d4efe4 to
059e921
Compare
dfederm
had a problem deploying
to
integration
February 17, 2026 19:17 — with
GitHub Actions
Failure
dfederm
force-pushed
the
feature/reference-trimmer
branch
from
February 17, 2026 20:07
059e921 to
6b0849e
Compare
dfederm
marked this pull request as ready for review
February 17, 2026 20:25
Member
Author
|
Pinging some recent contributors since this has been sitting for a while: |
westey-m
reviewed
Mar 4, 2026
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Abstractions\Agents.Abstractions.csproj" /> | ||
| <ProjectReference Include="..\..\SemanticKernel.Core\SemanticKernel.Core.csproj" /> |
Contributor
There was a problem hiding this comment.
This type of change may be a breaking change for some users. If a user depended on only Agents.Bedrock but also used artifacts from SemanticKernel.Core, it would cause the code not to compile after taking the new version of Agents.Bedrock. This is unfortunate, since cleaning up these references is actually really nice.
Contributor
|
Closing this PR, since many of these changes would be potentially breaking, and therefore not something we can do at this stage for Semantic Kernel. |
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.
Add ReferenceTrimmer to enable detection of unnecessary project, package, and assembly references during build. Remove all unused references identified by ReferenceTrimmer.
Note: Because both ProjectReferences and PackageReferences are transitive, sometimes removing an unused dependency will cause build errors due to missing a dependency that was previously pull in transitively. In these cases, the reference is explicitly added. So despite this change having many added references, it's actually reducing references as those added references were previously underdefined but existing dependencies (due to transitivity).
Disclosure: I own ReferenceTrimmer, but I do think it will be helpful to this repo, as evidenced by the many unused references it was able to identify. Adding it to your repo will help keep the references clean.