Interviews - C# Corner

Dennis Thomas
Can we use await in catch and finally blocks?
By Dennis Thomas in C# onDec 18 2017
  • Dennis Thomas
    Dec, 2017 18

    Yes, we can use it, from C# 6.0 onward. C# 6 was introduced with Visual Studio 2015. It supports using await in catch and finally blocks.

    • 3
  • Gajendra Jangid
    Jan, 2018 31

    C# 6.0 came with another new feature along with Visual Studio 2015 and .NET 4.6. Now you will be able to write await operations in catch {} and finally {} blocks too.

    • 2
  • Bidyasagar Mishra
    Aug, 2019 4

    yes

    • 0
  • Binod Kumar
    Jun, 2019 28

    try { throw new Exception(); } catch { await Task.Delay(1000); //using await in catch block } finally { await Task.Delay(1000); //using await in finally block }

    • 0
  • sushil kumar
    Mar, 2019 8

    Yes, we can use await in catch and finally blocks in c# 6.0 onwards.

    • 0
  • Sanjit Kumar Singh
    May, 2018 5

    yes

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS