dotnet / dotnet/docs

Document EventSource trim feature switch behavior

Open
#23,325 0 comments 0 reactions 0 assignees View on GitHub
dotnet-fundamentals/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
15h 21m
Merged PRs (30d)
370

Description

**Issue description**
Developers can also use feature switches to get additional size benefits when they [trim](https://docs.microsoft.com/en-us/dotnet/core/deploying/trim-self-contained) an application. One such feature switch is turning off generated events from an application (through the feature switch, [EventSourceSupport](https://github.com/dotnet/runtime/blob/main/docs/workflow/trimming/feature-switches.md)) which can be confusing to consumers of the applications since event support has been always present in .NET applications. For example, a customer using [dotnet-trace](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace) on the trimmed application that has this feature switch turned on (set to false) will not get expected behavior from the application.

We don't expect mainline server scenarios to use this feature switch but for those who do (primarily client side applications looking to run in size constrained environments), documenting the impact is an important strategy we plan to adopt for end-users to check when their .NET application doesn't generate events. [This](https://github.com/dotnet/runtime/issues/43657#issuecomment-791759620) issue comment discusses the planned behavior but a high level overview is the message quoted in that issue, "if you do X, all events will be disabled". We plan to fix our diagnostics tools (for example, see [this ](https://github.com/dotnet/runtime/issues/47062)issue where external tracing tools will get some notification of events being turned off) but as mentioned above, documentation of the behavior is a critical part for users.

**Target framework**

- [ ] .NET

[Edited to add document details]

---
#### Document Details

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

* ID: a1a6f297-c659-3770-42d9-d277895b5d25
* Version Independent ID: 3061aedd-2264-90da-b244-b8ed7bf416fc
* Content: [Trim self-contained applications - .NET](https://docs.microsoft.com/en-us/dotnet/core/deploying/trim-self-contained)
* Content Source: [docs/core/deploying/trim-self-contained.md](https://github.com/dotnet/docs/blob/main/docs/core/deploying/trim-self-contained.md)
* Product: **dotnet-fundamentals**
* GitHub Login: @jamshedd
* Microsoft Alias: **jamshedd**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.