You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/host-and-deploy/configure-trimmer.md
+12-18Lines changed: 12 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ For more information, see [Trimming options (.NET documentation)](/dotnet/core/d
42
42
43
43
## Failure to preserve types used by a published app
44
44
45
-
Trimming may have detrimental effects for a published app leading to runtime errors. In apps that use [reflection](/dotnet/csharp/advanced-topics/reflection-and-attributes/), the IL Trimmer often can't determine the required types for runtime reflection and trims them away. This can happen with complex framework types used for JS interop, JSON serialization/deserialization, and other operations.
45
+
Trimming may have detrimental effects for a published app leading to runtime errors. In apps that use [reflection](/dotnet/csharp/advanced-topics/reflection-and-attributes/), the IL Trimmer often can't determine the required types for runtime reflection and trims them away or trims away parameter names from methods. This can happen with complex framework types used for JS interop, JSON serialization/deserialization, and other operations.
46
46
47
47
Consider the following client-side component in a Blazor Web App (ASP.NET Core 8.0 or later) that deserializes a <xref:System.Collections.Generic.KeyValuePair> collection (`List<KeyValuePair<string, string>>`):
48
48
@@ -76,7 +76,7 @@ Consider the following client-side component in a Blazor Web App (ASP.NET Core 8
76
76
}
77
77
```
78
78
79
-
The preceding component executes normally when the app is run locally:
79
+
The preceding component executes normally when the app is run locally and produces the following rendered definition list (`<dl>`):
80
80
81
81
> **:::no-loc text="key 1":::**
82
82
> :::no-loc text="value 1":::
@@ -100,26 +100,20 @@ public sealed class StringKeyValuePair(string key, string value)
100
100
}
101
101
```
102
102
103
-
The component is modified to use the `StringKeyValuePair` type. Because custom types are never trimmed by Blazor when an app is published, the component works as designed:
103
+
The component is modified to use the `StringKeyValuePair` type:
Because custom types are never trimmed by Blazor when an app is published, the component works as designed after the app is published.
116
+
123
117
The IL Trimmer is also unable to react to an app's dynamic behavior at runtime. To ensure the trimmed app works correctly once deployed, test published output frequently while developing.
0 commit comments