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

The StaticMethodMustNotBeVoid analyzer should ignore Main #2

Open
DavidArno opened this issue Mar 16, 2016 · 0 comments
Open

The StaticMethodMustNotBeVoid analyzer should ignore Main #2

DavidArno opened this issue Mar 16, 2016 · 0 comments
Assignees

Comments

@DavidArno
Copy link
Owner

Currently, StaticMethodMustNotBeVoid reports an error on the Main entry-point method of an application. Main has to be void.

Winform applications are decorated with [STAThread], but this doesn't apply to console applications. The method can be decorated with [HasSideEffects], but this somehow seems odd for an entry point method.

One solution would be to simply have the analyzer ignore methods called Main.

What might be better is to add support for a new [ApplicationStartup] attribute that can be used in this situation. It's tempting to limit this to methods named Main, but other folk may well use other method names, which would cause problems.

@DavidArno DavidArno self-assigned this Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant