Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can we trim dll unused? #78633

Closed
1 task done
srxqds opened this issue Nov 21, 2022 · 4 comments
Closed
1 task done

how can we trim dll unused? #78633

srxqds opened this issue Nov 21, 2022 · 4 comments
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers question Answer questions and provide assistance, not an issue with source code or documentation.

Comments

@srxqds
Copy link
Contributor

srxqds commented Nov 21, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have found some dll like diagnostic should not used in product release:
image

Expected Behavior

no loading these assembly, or can config some assembly not loading

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0 blazor webasembly

Anything else?

No response

@javiercn javiercn transferred this issue from dotnet/aspnetcore Nov 21, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 21, 2022
@jeffschwMSFT jeffschwMSFT added the area-Tools-ILLink .NET linker development as well as trimming analyzers label Nov 21, 2022
@ghost
Copy link

ghost commented Nov 21, 2022

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have found some dll like diagnostic should not used in product release:
image

Expected Behavior

no loading these assembly, or can config some assembly not loading

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0 blazor webasembly

Anything else?

No response

Author: srxqds
Assignees: -
Labels:

untriaged, area-Tools-ILLink

Milestone: -

@vitek-karas
Copy link
Member

These dlls contains functionality like ability to print out stack trace (used when you call Exception.ToString), tracing support (ability to collect things like counters and so on), and support for some debugging functionality.

For the most part developers want these features even in their published applications so that it's easier to diagnose issues which happen in production.

Some of these can be disabled via properties:
https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-7-0#trimming-framework-library-features

If you just change the property values the functionality will be disabled, but the code will still be there (along with the above dlls). To remove most of the associated code you would also need to trim the application: https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained

Note that even in trimmed application it may be that some of these dlls will still be there (although probably smaller), it depends which APIs the application uses and how.

@agocke
Copy link
Member

agocke commented Nov 22, 2022

Closing as question seems answered.

@srxqds mentions that they're using Blazor, so they're probably already trimming. If the question is about figuring out what is being rooted in these types and why, I think that's a duplicate of #78671

@agocke agocke closed this as completed Nov 22, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 22, 2022
@teo-tsirpanis teo-tsirpanis added the question Answer questions and provide assistance, not an issue with source code or documentation. label Nov 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
Archived in project
Development

No branches or pull requests

5 participants