Search code examples
c#monomonodevelop

Monodevelop compile issue with ReadAsync


Monodevelop V5.1 & V5.9.8
Mono JIT compiler version 4.2.1

Monodevelop is complaing over this:

while ((numBytesRead = await stream.ReadAsync(data, 0, 1024)) >0)

Yet intellisense offers it up as an option

Error CS1061: Type System.IO.Stream' does not contain a definition forReadAsync' and no extension method ReadAsync' of type System.IO.Stream' could be found. Are you missing an assembly reference? (CS1061)


Solution

  • Manually adding the framework fixed it

    <PropertyGroup>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    </PropertyGroup>