Skip to content

Publish with async Main - Error CS8107: Feature 'async main' is not available in C# 7.0 #2751

Closed
@tonysneed

Description

When I publish an ASP.NET Core Web API that has an async Main method: public static async Task Main, I get the following error:

Program.cs(13,29): Error CS8107: Feature 'async main' is not available in C# 7.0. Please use language version 7.1 or greater.
CSC(0,0): Error CS5001: Program does not contain a static 'Main' method suitable for an entry point

This occurs even after setting the language version of each project in the solution to C# 7.2 for both Debug and Release build configurations.

Visual Studio 2017 Version: 15.5.2
OS Version: Windows 10 Pro Version 1709

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions