File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
docs/core/deploying/trimming Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -386,6 +386,7 @@ void ProcessData()
386386```
387387
388388This approach:
389+
389390- Makes it clear which specific call is suppressed
390391- Prevents accidentally suppressing other warnings if the code changes
391392- Keeps the justification close to the suppressed call
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ Assembly asm = Assembly.LoadFrom(pluginPath); // What's in this assembly?
4747```
4848
4949In these examples, the trimmer has no way to know:
50+
5051- Which type the user will enter
5152- What type ` GetSomeObject() ` returns
5253- What code exists in the dynamically loaded assembly
@@ -75,6 +76,7 @@ PrintMethodNames(typeof(DateTime));
7576```
7677
7778From the trimmer's perspective:
79+
78801 . It sees ` type.GetMethods() ` is called
79812 . It doesn't know what ` type ` will be (it's a parameter)
80823 . It can't determine which types' methods need to be preserved
@@ -109,6 +111,7 @@ PrintMethodNames(typeof(DateTime));
109111```
110112
111113Now the trimmer understands:
114+
1121151 . ` PrintMethodNames ` requires its parameter to have ` PublicMethods ` preserved
1131162 . The call site passes ` typeof(DateTime) `
1141173 . Therefore, ` DateTime ` 's public methods must be kept
You can’t perform that action at this time.
0 commit comments