7

I am using Visual Studio 15.5.6 version.

When I create a simple console application project I can't use ReadOnlySpan or Span or Memory.
I set the project to .Net Framework 4.7.1, because in Visual Studio that is the latest version.

Is there anybody using ReadOnlySpan<T> or Span<T>?

My purpose is to increase the code work speed.

ReadOnlySpan<char> charSpans="Test Words".AsReadOnlySpan();
GSerg
  • 76,472
  • 17
  • 159
  • 346
Murat Can OĞUZHAN
  • 735
  • 11
  • 19

1 Answers1

7

You need the prereleased Nuget package system.memory to use Span. Note this is for .net Core 2.0, .net standard 1.0 or 2.0, PCL, UAP 10.1 and Xamarin.Mac.

https://www.nuget.org/packages/System.Memory/4.4.0-preview1-25305-02

Read this article for more info on Span

https://msdn.microsoft.com/en-us/magazine/mt814808.aspx

Ken Tucker
  • 4,126
  • 1
  • 18
  • 24
  • Hi @Ken Tucker i download on package manager console and it is support for .net 4.7.1 Thank you for download link. I marked this answer the correct. You should remove .net 4.7.1 text. – Murat Can OĞUZHAN Feb 10 '18 at 19:21
  • @MuratCanOĞUZHAN System.Memory doesn't allow you to use AsReadOnlySpan on 4.7.1 that I can find – rollsch Jul 14 '21 at 02:56