Closed albertwoo closed 5 years ago
I guess that you have not included the assembly with #r... in your fsx script. Could you please paste your script here?
My script reference is like this:
#load ".fake/build.fsx/intellisense.fsx"
#if !FAKE
#r "netstandard"
#endif
open FSharp.Json
let empty = Json.serialize
The paket.dependencies file is look like:
// [ FAKE GROUP ]
group Build
storage none
source https://api.nuget.org/v3/index.json
nuget Fake.DotNet.Cli
nuget Fake.IO.FileSystem
nuget Fake.Core.Target
nuget FSharp.Data 3.0.0-beta4
nuget Newtonsoft.Json
fake will handle intellisense.fsx then #load intellisense_lazy.fsx, in there the #r will load the FSharp.json automatically.
Problem is if I do the same way with Newtonsoft.Json, it works but failed with FSharp.Json.
I see that you reference Newtonsoft.Json in your paket.dependencies. FSharp.Json is NOT Newtonsoft.Json. FSharp.Json is a separate package.
Sorry for the misunderstanding, what I mean is that if I replace Fsharp.Json with Newtonsoft.Json everything is working fine. But If I use Fsharp.Json then the error happens.
OK, I see. I need to investigate more. I suspect the netstandard
might be the reason for your problems. I haven't build FSharp.Json in netstandard yet. But I think I should as this issue (still open) suggests: https://github.com/vsapronov/FSharp.Json/issues/7
Please try to use release 0.3.4. It's built for .Net Standard, now it should work.
Thanks, it works great!
When I use this package in Fake script, it works fine when I sent to F# interactive, but failed when I run fake run script.fsx and the error is like "The namespace 'Json' is not defined."