Skip to content

Support File.ReadAllLinesAsync and friends on .NET Core 3 / netstandard2.1 #499

@christianrondeau

Description

@christianrondeau

Async methods were implemented in #481 (comment) but I think the precompiler directives or somehow the nuget binding doesn't get them.

Sample csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="System.IO.Abstractions" Version="6.0.21" />
  </ItemGroup>
</Project>

Sample code:

var lines = await new FileSystem().File.ReadAllLinesAsync(@"C:\file.txt")

I think the problem is simply that we're limited to NETCOREAPP2_0: https://github.com/fedoranimus/System.IO.Abstractions/blob/master/System.IO.Abstractions/FileBase.cs#L322 - you can probably instead use NETSTANDARD2_0 but I won't be able to test that right away. I won't be able to provide a PR as I'm off until the end of next week, but if no one took this issue when I'm back all provide one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues that address the core abstractions & the wrappersstate: ready to pickIssues that are ready for being worked ontype: enhancementIssues that propose new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions