Skip to content

rename _SuppressWinFormsTrimError to _SuppressWinFormsTrimWarning #44702

Open
@felixf4xu

Description

@felixf4xu

Is your feature request related to a problem? Please describe.

When a WinFoms project is using <PublishAot>true</PublishAot> but not <_SuppressWinFormsTrimError>true</_SuppressWinFormsTrimError> there will be an error:

Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(255,5): Error NETSDK1175: Windows Forms is not supported or recommended with trimming enabled.

This error is misleading.

Describe the solution you'd like

As long as _SuppressWinFormsTrimError is added, the error is gone, so this is not an error in my point of view, it's more like an warning.

So it's better to rename _SuppressWinFormsTrimError to _SuppressWinFormsTrimWarning.

When <PublishAot> is used but _SuppressWinFormsTrimWarning is not used, the AOT will run (this is a change), but with warning messages:

Windows Forms is not recommended with trimming enabled.

Just say "not recommended" instead of "not supported or recommended".

When _SuppressWinFormsTrimWarning is used, it works as what it is now.

Additional context

Most people don't know _SuppressWinFormsTrimError, it's not documented. Showing an error too early will prevent users from investigating into the other AOT options.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions