File.ReadAllLinesAsync not found

Moshe Wiener 36 Reputation points
2021-12-08T13:39:44.88+00:00

On VS2019 in a C# program, I try to refer to System.IO.File.ReadAllLinesAsync and get the error:
'File' does not contain a definition for 'ReadAllLinesAsync'
I use .NET6 and Framework4.7.2
Do I need to install anything to get it?

Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,536 Reputation points
    2021-12-08T14:03:09.833+00:00

    According to the documentation at system.io.file.readalllinesasync it is not available in the
    .Net Framework. You should be able to use it successfully in .Net 6

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.