我以一种奇怪的行为运行。
我正在尝试使用C#库:Neo4jClient
我在 FSI 中的代码如下所示:
#r "Neo4jClient.dll"
#r "Newtonsoft.Json"
open System
open Neo4jClient
// Define your library scripting code here
let client = new GraphClient(new Uri("http://localhost:7474/db/data"))
client.Connect()
并导致以下错误:
System.MissingMethodException: Method not found: 'Void Newtonsoft.Json.JsonReader.set_DateParseHandling(Newtonsoft.Json.DateParseHandling)'.
at Neo4jClient.Serialization.CustomJsonDeserializer.Deserialize[T](String content)
at Neo4jClient.HttpContentExtensions.ReadAsJson[T](HttpContent content, IEnumerable`1 jsonConverters) in c:TeamCitybuildAgentwork5bae2aa9bce99f44Neo4jClientHttpContentExtensions.cs:line 20
at Neo4jClient.GraphClient.Connect() in c:TeamCitybuildAgentwork5bae2aa9bce99f44Neo4jClientGraphClient.cs:line 188
at <StartupCode$FSI_0013>.$FSI_0013.main@() in C:UsersMattiaDocumentsVisual Studio 2012ProjectsGenChiGenChiSnooperScript.fsx:line 12
但是,如果作为 F# 应用程序执行,则相同的代码将正常运行。
open System
open Neo4jClient
[<EntryPoint>]
let main argv =
let client = new GraphClient(new Uri("http://localhost:7474/db/data"))
client.Connect();
printfn "Went through..."
printfn "%A" argv
0 // return an integer exit code
我不确定这个问题是否特定于库。我的问题是:在 FSI 中使用 C# 库是否有一些特定的黑客攻击?
咔嚓。
以管理员身份运行Visual Studio。 并参考最新的Newtonsof.Json包:
#I @"..packagesNeo4jClient.1.0.0.652libnet40"
#I @"..packagesNewtonsoft.Json.6.0.2libnet45"
#r "Neo4JClient.dll"
#r "Newtonsoft.Json.dll"
let client = new GraphClient(new Uri("http://host:7474/db/data"))
client.Connect()
printfn "conntected"