Wait for async Task without wrapping exceptions in AggregateException

后端 未结 3 744
天涯浪人
天涯浪人 2020-12-25 12:50

I am using a library which provides methods ending with ...Async and return Task. I am going to use these in a command line application

3条回答
  •  没有蜡笔的小新
    2020-12-25 13:24

    As of C# 7.1 you can now declare the Main method as async. Just have to make sure your language is either set to default major version (which should work in VS 2019 now) or you can always target a specific version of the language.

    See this link for details. Turn on async main

提交回复
热议问题