FSharp.Data icon indicating copy to clipboard operation
FSharp.Data copied to clipboard

FSharp.Data namespace conflict with Microsoft.FSharp.Data

Open dustysig opened this issue 4 years ago • 2 comments

I think I've run into a namespace conflict and I'm not sure how to resolve it in F#. The conflict is between FSharp.Data and what I'm assuming is a core part of F#(Microsoft.FSharp.Data)

`open System open FSharp.Data

[<Literal>] let SampleDataFile = SOURCE_DIRECTORY + "/DATA/FILENAME.CSV" type MyType = FSharp.Data.CsvProvider<SampleDataFile>

CreditCard.GetSample().Rows |> ignore`

However, when I send this to FSI I get this error,

` type MyType = FSharp.Data.CsvProvider<SampleDataFile> ------------------------------^^^^^^^^^^^

stdin(6,31): error FS0039: The type 'CsvProvider' is not defined in 'Microsoft.FSharp.Data'.`

I did the same thing in VS 2019 trying to directly manage the Nuget Packages and references, however this resulted in the same issue.

Can you advise if there is a way to resolve this?

dustysig avatar Jan 05 '22 20:01 dustysig

I don't think you're referencing FSharp.Data the package in your environment. This does not reproduce for me:

image

That said, if you're preferring to fully qualify all the names for things, you may run into similar issues over time.

cartermp avatar Jan 05 '22 20:01 cartermp

Thanks for the reply.

I assume you are in an .fsx file type? Can you reproduce this in a .fs file?

dustysig avatar Jan 05 '22 21:01 dustysig

Not OP, but I can confirm it does happen in a fsx file, but not in a fs file.

wilfriedb avatar May 05 '23 15:05 wilfriedb

Closing as the solution in fsx files it to ad the nuget references

dsyme avatar Mar 11 '24 22:03 dsyme

Closing as the solution in fsx files it to ad the nuget references

Hi, I need this in an .fs file NOT a .fsx.

dustysig avatar Mar 12 '24 13:03 dustysig