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

Port FxCop rule CA2232: MarkWindowsFormsEntryPointsWithStaThread #8384

Closed
Youssef1313 opened this issue Dec 14, 2022 · 6 comments
Closed

Port FxCop rule CA2232: MarkWindowsFormsEntryPointsWithStaThread #8384

Youssef1313 opened this issue Dec 14, 2022 · 6 comments
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation

Comments

@Youssef1313
Copy link
Member

Youssef1313 commented Dec 14, 2022

Title: Mark Windows Forms entry points with STAThread

Description:

STAThreadAttribute indicates that the COM threading model for the application is a single-threaded apartment. This attribute must be present on the entry point of any application that uses Windows Forms; if it is omitted, the Windows components might not work correctly.

https://learn.microsoft.com/en-us/visualstudio/code-quality/ca2232

@Youssef1313 Youssef1313 added api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation untriaged The team needs to look at this issue in the next triage labels Dec 14, 2022
@Youssef1313
Copy link
Member Author

If it was decided not to implement this analyzer in dotnet/winforms, please make sure dotnet/roslyn-analyzers#545 is reopened.

@RussKie
Copy link
Member

RussKie commented Dec 14, 2022

It looks like you've copy-pasted the wrong wording ;)

@Youssef1313
Copy link
Member Author

It looks like you've copy-pasted the wrong wording ;)

Fixed now. Thanks for noting!

@merriemcgaw merriemcgaw closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2023
@Youssef1313
Copy link
Member Author

@merriemcgaw Why this was closed?

@JeremyKuhne
Copy link
Member

Why this was closed?

Sorry the justification got missed. As our templates have this already and the runtime error you get is pretty clear we don't feel it has enough value.

@RussKie
Copy link
Member

RussKie commented Feb 9, 2023

It's worth noting that some developers are trying to run async Main, so this analyzer would help avoiding that. dotnet/roslyn#22112

@ghost ghost locked as resolved and limited conversation to collaborators Mar 11, 2023
@dreddy-work dreddy-work removed the untriaged The team needs to look at this issue in the next triage label May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation
Projects
None yet
Development

No branches or pull requests

5 participants