F# NetStandard 2 Sytem.Net.Http name space missing

190 Views Asked by At

I am new to F# and I apologize if this question was asked before, but I could not find it.

I am trying to create an F# DLL in NetStandard 2.0 and I would like to use HttpClient

open System.Net.Http does not work: The namespace 'Net' is not defined.

I looked and could not find any solutions specific to F# and HttpClient in the context of NetStandard 2.0

The name space System.Net.Http is there on the C# side using in NetStandard 2.0. No problem there.

On F#, intellisense does not show the .Http namespace when expanding System.Net

Any ideas would be greatly appreciated.

TIA,

David

1

There are 1 best solutions below

3
On

That namespace is an assembly that is not automatically referenced as part of .NET, so it needs to be referenced for each project that uses it. It's possible that the C# project already had the reference, or your tooling added it automatically when you tried to open the namespace. So you just need to add a reference to the DLL "System.Net.Http" in your F# project.