Skip to content

Trimmed apps cannot set System.Net.Security.UseManagedNtlm AppContext switch #123472

@MichalStrehovsky

Description

@MichalStrehovsky

We document this AppContext switch: https://learn.microsoft.com/en-us/dotnet/api/system.net.networkcredential?view=net-10.0

But then we hardcode a value at build time for anything that is trimmed, so it's impossible to actually set the AppContext switch directly:

<!-- Trim managed NTLM on Linux when it's not explicitly requested -->
<_UseManagedNtlm Condition="'$(_UseManagedNtlm)' == '' and $(RuntimeIdentifier.StartsWith('linux'))">false</_UseManagedNtlm>

I'm going to disable test that was enabled in #123055 on this issue for native AOT because the test is still using native NTLM once trimmed and it's segfaulting in native AOT outerloop runs.

Ref #90957 that had a lot of discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.Securitydisabled-testThe test is disabled in source code against the issueuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions