Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add multi-targeting sections to trimming and AOT documentation#50076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Copilot wants to merge13 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/add-multi-targeting-recommendations

Conversation

Copy link
Contributor

CopilotAI commentedNov 20, 2025
edited by github-actionsbot
Loading

Adding multi-targeting sections to trimming and AOT documentation

  • Explore repository structure and understand the issue
  • Review current documentation in prepare-libraries-for-trimming.md
  • Review related breaking change document
  • Add new H2 section "Multi-targeting for trimming" after "Enable library trim warnings"
  • Include recommendations for multi-targeting scenarios
  • Add example showing conditional IsTrimmable usage
  • Explain common multi-targeting scenarios (netstandard2.0, net472, net6.0+)
  • Link to breaking change document
  • Verify markdown linting passes
  • Update document metadata date
  • Address review feedback - simplify section to brief statement + example
  • Clarify multi-targeting recommendation to avoid TFM gaps
  • Move IsAotCompatible multi-targeting guidance to AOT docs
  • Update AOT docs to use net8.0 (earliest version with AOT compat analysis)
  • Update SDK error messages to specify net6.0 for trimming, net8.0 for AOT
  • Add recommendation to include latest .NET version for latest analyzer
  • Update examples to use net10.0 as latest version
  • Add Oxford commas to framework lists per writing style guidelines
  • Break up long sentences for better readability
  • Final review and validation

Summary

Per@sbomer's feedback:

  • Broke up long sentences in both trimming and AOT documentation sections for better readability
  • Changed structure to imperative mood: "if your library targets..., multi-target to..."
  • Split explanation into shorter, clearer sentences
  • Changed "Additionally, consider including" to "Also, include"
  • Changed "to ensure your library is analyzed" to "so your library is analyzed"
Original prompt

This section details on the original issue you should resolve

<issue_title>Prepare .NET libraries for trimming: Add multi-targeting H2 with our recommendations</issue_title>
<issue_description>
Seethis comment copied below

Finally, recently we've learned that multi-targeting is not only very common, but basically a must have when enabling trimming. (This is based on experience trying to make some NuGets trim compatible). I think the document should have a section about the multi-targeting and our recommendations around it. But the core point is that very few libraries will only target latest TFM. By far the most common case is either library targetsnetstandard2.0 or it multi-targetsnet472,netstandard2.0 andnet6.0 (or some combination of these).


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Comments on the Issue (you are@copilot in this section)

@sbomerLeaving a note here to mention the new behavior in the `true` part of https://learn.microsoft.com/dotnet/core/deploying/trimming/prepare-libraries-for-trimming.@sbomerI'm adding a breaking change notice that mentions multi-targeting: https://github.com//pull/36775. We still need a dedicated section in the general trimming docs though. When that's added, we should also link to it from the breaking change notice.

✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File🔗 Preview link
docs/core/deploying/native-aot/index.mddocs/core/deploying/native-aot/index
docs/core/deploying/trimming/prepare-libraries-for-trimming.mddocs/core/deploying/trimming/prepare-libraries-for-trimming
docs/core/tools/sdk-errors/index.mddocs/core/tools/sdk-errors/index

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
CopilotAI changed the title[WIP] Prepare .NET libraries for trimming with multi-targeting recommendationsAdd multi-targeting section to trimming documentationNov 20, 2025
CopilotAI requested a review fromsbomerNovember 20, 2025 22:36
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
CopilotAI requested a review fromsbomerDecember 2, 2025 19:22
@sbomersbomer requested a review froma teamDecember 2, 2025 19:39
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Copy link
Member

@sbomersbomer left a comment

Choose a reason for hiding this comment

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

@copilot Add a similar note for IsAotCompatible (alongside the existing docs for that option).

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Copy link
ContributorAuthor

CopilotAI commentedDec 2, 2025

@copilot Add a similar note for IsAotCompatible (alongside the existing docs for that option).

Added in 78f6612. The note directs users to apply the same multi-targeting guidance when usingIsAotCompatible in multi-targeted projects, with a link to the "Multi-targeting for trimming" section.

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
@sbomersbomer marked this pull request as ready for reviewDecember 4, 2025 23:12
@sbomersbomer requested review froma team andmeaghanlewis ascode ownersDecember 4, 2025 23:12
CopilotAI review requested due to automatic review settingsDecember 4, 2025 23:12
@sbomersbomer requested a review froma teamDecember 4, 2025 23:12
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

CopilotAI 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 3 out of 3 changed files in this pull request and generated 4 comments.


###Multi-targeting for AOT compatibility

When preparing libraries for AOT compatibility, if your library targets any framework earlier than`net8.0` (such as`netstandard2.0` or`net472`), you should also multi-target to`net8.0` to ensure that apps targeting`net8.0` or above get a version of your library that supports the AOT analyzers. Additionally, consider including the latest .NET version to ensure your library is analyzed with the latest analyzer. Use the`IsTargetFrameworkCompatible` MSBuild function to conditionally enable`IsAotCompatible` for`net8.0` and above:
Copy link

CopilotAIDec 5, 2025

Choose a reason for hiding this comment

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

Missing Oxford comma in the list. According to the Markdown writing style guidelines, you must use the Oxford comma in all lists. Change(such as \netstandard2.0` or `net472`)to(such as `netstandard2.0`, or `net472`)` to include the comma before "or".

Copilot generated this review using guidance fromrepository custom instructions.
Copy link
Member

Choose a reason for hiding this comment

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

@copilot apply changes based onthis feedback

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Added Oxford comma in603021d. Changed(such as \netstandard2.0` or `net472`)to(such as `netstandard2.0`, or `net472`)`.

Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Copy link
Contributor

CopilotAI 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 3 out of 3 changed files in this pull request and generated 2 comments.

Co-authored-by: sbomer <787361+sbomer@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@meaghanlewismeaghanlewisAwaiting requested review from meaghanlewismeaghanlewis is a code owner

@adegeoadegeoAwaiting requested review from adegeoadegeo is a code owner

@sbomersbomerAwaiting requested review from sbomer

@jtschusterjtschusterAwaiting requested review from jtschuster

At least 1 approving review is required to merge this pull request.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Prepare .NET libraries for trimming: Add multi-targeting H2 with our recommendations

3 participants

@sbomer@jtschuster

[8]ページ先頭

©2009-2025 Movatter.jp