Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename _SuppressWinFormsTrimError to _SuppressWinFormsTrimWarning #44702

Open
felixf4xu opened this issue Nov 7, 2024 · 2 comments
Open

rename _SuppressWinFormsTrimError to _SuppressWinFormsTrimWarning #44702

felixf4xu opened this issue Nov 7, 2024 · 2 comments

Comments

@felixf4xu
Copy link

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.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Nov 7, 2024
@marcpopMSFT
Copy link
Member

@merriemcgaw since this is the winforms development experience.

@merriemcgaw
Copy link
Member

Chatting with the team and will circle back.

@marcpopMSFT marcpopMSFT removed the untriaged Request triage from a team member label Nov 12, 2024
@marcpopMSFT marcpopMSFT added this to the Discussion milestone Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants