Skip to content

Update complex type trimming remarks #34654

@guardrex

Description

@guardrex

Description

To resolve #31422, language was added to two articles to cover how some complex types might be trimmed away.

In the Trimmer article ...

Trimming may have detrimental effects for the 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 trim them away. For example, complex framework types for JS interop, such as <xref:System.Collections.Generic.KeyValuePair>, might be trimmed by default and not available at runtime for JS interop calls. In these cases, we recommend creating your own custom types instead.

In the JS interop overview article ...

Complex framework types, such as <xref:System.Collections.Generic.KeyValuePair>, might be [trimmed away by the IL Trimmer on publish](xref:blazor/host-and-deploy/configure-trimmer) and not present for JS interop. We recommend creating custom types for types that the IL Trimmer trims away by default.

@maraf and @lewing ... Two questions ...

  1. Is there a complex type that I can swap in for KeyValuePair that would still be trimmed away?

  2. [release/8.0-staging][wasm] remove problematic default settings runtime#112216 is for release 8.0+, correct?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/configure-trimmer?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/configure-trimmer.md

Document ID

1487b5e7-a40c-d757-c530-d0e4017f189e

Article author

@guardrex

Metadata

  • ID: 2203b81b-1b37-8599-eb50-f6284170d224
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions