Question: I have this F# code:

```
open System
open System.Collections.Generic

let f (subArr: Span<int>) =
    42

```

However, I get `Span` underlined red and the error says 

> 
> The type 'Span' is not defined in 'System'
> 
> 
> 

I use the latest version of VS Code with Ionide plugin. I thought maybe something went bugged there, so I tested with the interpreter but got the same result. I consulted with MSDN docs, but it seems like I have all the imports that I need.

What am I missing? How do I use `Span<T>` in F#?

Answer: 
Marc and Phillip are both right: `Span<T>` is only built-in if you're targeting .NET Core 2.1+ or .NET Standard 2.1. Otherwise, you need the System.Memory nuget package.
Thanks everyone, since I don't have a full-blown project, but just a .fsx script, I decided to go with switching to .NET Core. This is how you do it in VS Code:

[![enter image description here](https://i.stack.imgur.com/02dck.png)](https://i.stack.imgur.com/02dck.png)

BTW it seems like it's still possible to use nuget packages with a script, if you follow the instructions [here](https://stackoverflow.com/questions/34813796/can-i-install-reference-packages-from-within-an-fsx-file), but I had neither luck with it, nor a wish to carry the whole folder structure with the file.