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

CC0068 Triggers on static async Task for console main application #1041

Open
nonsensesoftware opened this issue Jan 16, 2020 · 0 comments
Open

Comments

@nonsensesoftware
Copy link

nonsensesoftware commented Jan 16, 2020

Starting with C# 7.1 features, a Main method (the entry point for an application) can be declared as async, and can return a Task. CC0068 incorrectly triggers stating that this method should be removed because it is unused. However, you cannot remove the Main method for an application otherwise it would not compile or run.

Coincidentally, if I change the Main method from async Task to just void Main, the rule does not get triggered as I would expect.

static async Task Main(string[] args)
{
    //Do something here
}
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

2 participants