How can I read a text file in .Net Standard version 1.0 or 1.1?

Viewed 136

I want to read the contents of a text file.

Is this possible in .Net Standard 1.0 or 1.1?

File.ReadAllLines("...");

enter image description here

2 Answers

Long story short: NO

Check this link File class in net standard 1.1

enter image description here

Why not go to 1.3? You shouldn't have any breaking compatibility issues. I don't see any work arounds that are easy to implement.

You can also check compatibility table to see if you can use the version without any issue, based on the framework where you want to consume the library.

Solution:

I needed to use a library for all projects with different dot net versions like dot net framework 4.5 and dot net core 5.

The TargetFrameworks in my project ".csproj file" was as follows:

<TargetFrameworks>netstandard1.0;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>

I had to use it as follows:

<TargetFrameworks>net45;net451;net452;netstandard1.3;netstandard1.4;netstandard1.5;netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>

My problem was solved.

Related