dotnet / dotnet/sdk

rename `_SuppressWinFormsTrimError` to `_SuppressWinFormsTrimWarning`

Open
#44,702 2 comments 0 reactions 0 assignees View on GitHub
Area-NetSDK
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

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

When a WinFoms project is using `true` but not `<_SuppressWinFormsTrimError>true` 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 `` 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.