Skip to content

Developers want to be confident that their apps run successfully when trimmed to avoid debugging trimming related problems at runtime #43078

Closed

Description

@agocke

In 5.0 we introduced linker capability to warn about code and patterns which are not trimming safe. We will build on top of that feature to resolve all warnings in our core SDKs to allow developers to enable this linker capability for their code and 3rd party libraries to give them confidence that trimming does not alter their app behaviour unexpectedly.

We'll also work on further enhancing the warning user experience to give the developers feedback about potential problems in their app as early as possible.

The primary goal for .NET6 is to have all linker related warnings resolved for core SDKs for all workloads which use publish with trimming enabled by default. In particular following workloads

  • Blazor Client/WebAssembly
  • Mobile iOS/tvOS (Xamarin.iOS)
  • Mobile Android (Xamarin.Android)
  • macOS UI (Xamarin.Mac)
  • Hybrid Blazor (optional)

Work Items

Partner dependencies:

MaciOS

Activity

  1. added
    EpicGroups multiple user stories. Can be grouped under a theme.
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Oct 6, 2020
  2. added this to the 6.0.0 milestone on Oct 6, 2020
  3. added and removed
    EpicGroups multiple user stories. Can be grouped under a theme.
    on Oct 19, 2020
  4. changed the title [-]"Linkable framework" for Console & ASP.NET apps[/-] [+]"Linkable framework" for netcoreapp[/+] on Oct 23, 2020
  5. added
    User StoryA single user-facing feature. Can be grouped under an epic.
    on Nov 16, 2020
  6. added
    Priority:1Work that is critical for the release, but we could probably ship without
    on Nov 16, 2020
  7. danmoseley commented on Nov 25, 2020

    @danmoseley
    Contributor

    @eerhardt this would be the parent story for most of your v-team's work -- any sub work items can be children of this (they will appear in themes tree) or at least checkboxes in this or a child issue similar to what we did for Nullability annotations. When you are ready to can you please link such child items, etc so all necessary work is represented here or in its children?

  8. 2 remaining items

  9. eerhardt commented on Dec 7, 2020

    @eerhardt
    Member

    at least checkboxes in this or a child issue similar to what we did for Nullability annotations

    For the ILLink warnings burndown, I've created #45623 (which is linked above). It will be used to check off assemblies as we get them ILLink warning "clean".

  10. added
    Priority:0Work that we can't release without
    and removed
    Priority:1Work that is critical for the release, but we could probably ship without
    on Dec 9, 2020
  11. marek-safar commented on Dec 9, 2020

    @marek-safar
    Contributor

    Changed priority to P0 to align with Xamarin needs

  12. danmoseley commented on Jan 5, 2021

    @danmoseley
    Contributor

    @agocke I have marked this 'committed'. LMK if that's not correct but surely it is. There may be some of the child work items that are aspirational but we are committed to this story

  13. smagurauskas commented on Feb 8, 2021

    @smagurauskas

    Is there a plan to make trimming feature available not only for self-contained deployments?

  14. marek-safar commented on Feb 8, 2021

    @marek-safar
    Contributor

    @tomkaa what would be the scenario where you would like to use the trimming?

  15. smagurauskas commented on Feb 8, 2021

    @smagurauskas

    @marek-safar For example: I am developing ASP.NET Core application which has some NuGet packages installed and use framework-dependent deployment model. Some of the assemblies from NuGet are only used as middleware for local debugging. I have these middleware registrations surrounded with #if DEBUG, so in Release build these assemblies are technically not referenced anywhere, but I still have them in csproj so they get copied anyway. Current solution is to surround the <PackageReference ...> with <ItemGroup> and add Condition attribute that includes it only when configuration is DEBUG. However I think it would be great quality of life improvement if these could be trimmed automatically, even for framework dependent deployment.

  16. eerhardt commented on Jul 30, 2021

    @eerhardt
    Member

    @agocke - do you think this issue can now be closed? The only issue under "Work Items" that is still open is #39274. We can track adding other platforms in that issue.

  17. agocke commented on Jul 30, 2021

    @agocke
    MemberAuthor

    Yup, I think this is ready to close.

  18. ghost locked as resolved and limited conversation to collaborators on Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Priority:0Work that we can't release withoutTeam:LibrariesTeam:RuntimeUser StoryA single user-facing feature. Can be grouped under an epic.area-Metalinkable-frameworkIssues associated with delivering a linker friendly framework

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions