Like Patryk Ćwiek, I can't reproduce the behaviour you describe. It works fine with Json.NET 6.0.2 on F# 3.1. However, there are some problems with your code listing, which doesn't compile as given.
You need to open the appropriate namespaces (or modules):
open System
open Newtonsoft.Json
Also, F# uses significant whitespace, so the code listing should be like on the original blog:
type Shape =
| Rectangle of width : float * length : float
| Circle of radius : float
| Empty
[<EntryPoint>]
let main argv =
let shape1 = Rectangle(1.3, 10.0)
let json = JsonConvert.SerializeObject(shape1)
// {
// "Case": "Rectangle",
// "Fields": [
// 1.3,
// 10.0
// ]
// }
let shape2 = JsonConvert.DeserializeObject<Shape>(json)
Console.ReadKey() |> ignore
0
Notice that all code below let main argv =
is indented.