C#类-System.MissingMethodException在FSI中时出现异常
我有一种奇怪的行为 我正在尝试使用一个C#library:the 我在FSI中的代码如下所示:C#类-System.MissingMethodException在FSI中时出现异常,c#,f#,missingmethodexception,fsi,C#,F#,Missingmethodexception,Fsi,我有一种奇怪的行为 我正在尝试使用一个C#library:the 我在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
#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
System.MissingMethodException:找不到方法:“Void Newtonsoft.Json.JsonReader.set_DateParseHandling(Newtonsoft.Json.DateParseHandling)”。
在Neo4jClient.Serialization.CustomJsonDeserializer.Deserialize[T](字符串内容)中
在c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\HttpContentExtensions.ReadAsJson[T](HttpContent内容,IEnumerable`1 jsonConverters)中的Neo4jClient.HttpContentExtensions.ReadAsJson[T](第20行
在c:\TeamCity\buildAgent\work\5bae2aa9bce99f44\Neo4jClient\GraphClient.cs中的Neo4jClient.GraphClient.Connect()处:第188行
在C:\Users\Mattia\Documents\Visual Studio 2012\Projects\GenChi\GenChiSnooper\Script.fsx中的.fsi0013.main@()处:第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
开放系统
打开Neo4jClient
[]
让主argv=
让客户端=新的GraphClient(新的Uri(“http://localhost:7474/db/data"))
client.Connect();
printfn“通过…”
printfn“%A”argv
0//返回整数退出代码
我不确定这个问题是否与图书馆有关。
我的问题是:在FSI中使用C#库是否存在一些特定的黑客行为
Tnx.以管理员身份运行visual studio。并参考最新的Newtonsof.Json包:
#I @"..\packages\Neo4jClient.1.0.0.652\lib\net40"
#I @"..\packages\Newtonsoft.Json.6.0.2\lib\net45"
#r "Neo4JClient.dll"
#r "Newtonsoft.Json.dll"
let client = new GraphClient(new Uri("http://host:7474/db/data"))
client.Connect()
printfn "conntected"
您是否也在fsi中引用了json dll?是的,我引用了。我还试图降低json dll的级别。我假设json缺少的
dll
是一个输入错误?这一定是dll地狱问题。使用Fuslogvw.exe并记录所有绑定,以了解在FSI中运行时Newtonsoft.Json.dll的来源。检查在FSI中使用的.net和F#与您的F#应用程序的版本。以管理员身份运行修复了一个问题。我不知道为什么。谢谢