Skip to content

When using TrimMode=link custom AndroidHttpClientHandlerType is not preserved #8797

Closed
@jonathanpeppers

Description

@jonathanpeppers

Android application type

.NET Android (net7.0-android, net8.0-android, etc.)

Affected platform version

.NET 8, 9, etc.

Description

If you use the project settings:

<TrimMode>link</TrimMode>
<AndroidHttpClientHandlerType>MyNamespace.MyCustomHandler</AndroidHttpClientHandlerType>

In this case, nothing would preserve MyCustomHandler and it would be trimmed away.

Steps to Reproduce

Use project settings above.

Did you find any workaround?

You could use either [DynamicDependency] or [DynamicallyAccessedMembers] to preserve the type. You could also instantiate the handler in code.

Relevant log output

No response

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.bugComponent does not function as intended.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions