0

i'm learning how to create a c# http client. i'm following microsoft docs, but i can't compile the code, beacuse i get the following error: "The program doesn't contain a method static Main as an entry point. This is the code:

namespace WebAPIClient
{
    class Program
    {
        private static readonly HttpClient client = new HttpClient();

        static async Task Main(string[] args)
        {
            //...
        }
    }
}

I wasn't able to find something useful on internet. Thank you for your help

  • Tell us the version of the compiler you use, as the only reason why [it](https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-7-1#async-main) doesn't work in such a way is as if you use some older compiler/VisualStudio version. – Eugene Podskal Feb 25 '20 at 18:57
  • yes it does, thanks a lot! – Giulio Andini Feb 25 '20 at 18:57

0 Answers0