0

I'm using .NET Framework, and I'm wanting to call an awaitable function in my Main entry-point function.

I'm using the async keyword on the function, but it keeps giving me CS5001 Program does not contain a static 'Main' method suitable for an entry point. Although it doesn't say anything about it not being async.

It seems this error is related to the problem.

mekb
  • 554
  • 8
  • 22
  • 1
    Have a read through the answer on the duplicate question there are some really handy ones which explain how to achieve what you are after – Izzy Aug 13 '19 at 10:40

1 Answers1

4

Async Main methods were introduced with C#7.1, so if you are targeting that or above, you can use it.

Lukas
  • 498
  • 2
  • 12