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
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,12 +42,13 @@ 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. 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 for types used for JS interop and JSON serialization/deserialization. For example, complex framework types, such as <xref:System.Collections.Generic.KeyValuePair>, might be trimmed and not available at runtime.
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.
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>>`):
@@ -101,18 +103,15 @@ public sealed class StringKeyValuePair(string key, string value)
101
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:
0 commit comments