【发布时间】:2014-03-31 08:32:07
【问题描述】:
我的行为很奇怪。
我正在尝试使用 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:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\HttpContentExtensions.cs:line 20
at Neo4jClient.GraphClient.Connect() in c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\GraphClient.cs:line 188
at <StartupCode$FSI_0013>.$FSI_0013.main@() in C:\Users\Mattia\Documents\Visual Studio 2012\Projects\GenChi\GenChiSnooper\Script.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# 库是否存在一些特定的黑客行为?
Tnx.
【问题讨论】:
-
你是否也引用了fsi中的json dll?
-
是的,我做到了。我也尝试过降级 json dll
-
我认为 json 中缺少的
dll是一个错字? -
这一定是DLL Hell问题。使用 Fuslogvw.exe 并记录所有绑定,以便了解在 FSI 中运行时 Newtonsoft.Json.dll 的来源。
-
检查您在 fsi 和您的 F# 应用程序中使用的 .net 和 F# 版本。
标签: c# f# missingmethodexception fsi