2016-09-16 6 views
1

私はXamarinアプリケーション内から、私のローカルのNeo4jデータベースとの通信にのNeo4jの.NETドライバを使用しようとしています。メソッド「Sockets.Plugin.Abstractions.ITcpSocketClient.ConnectAsync」が見つかりません(のNeo4jドライバ)

これは私のコードです:

using Neo4j.Driver.V1; // I have this at the top of the class 

//and this in the constructor just to test it 
using (var driver = GraphDatabase.Driver("bolt://localhost", AuthTokens.Basic("neo4j", "root"))) 
using (var session = driver.Session()) 
{ 
    session.Run("CREATE (a:User {name:'Arthur'})"); 
} 

それは、本質的に、彼らは彼らのウェブサイト(https://neo4j.com/developer/language-guides/)の例として与える同じコードです。

私は、私は次のエラーを取得するプロジェクトを実行しよう:

enter image description here

System.AggregateException: One or more errors occurred. ---> System.MissingMethodException: Method 'Sockets.Plugin.Abstractions.ITcpSocketClient.ConnectAsync' not found. 
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00031] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:316 
    at Neo4j.Driver.Internal.Connector.SocketClient.Start() [0x00023] in <d05dc2e6bd2a40acab42430b347d4724>:0 
    at Neo4j.Driver.Internal.Connector.SocketConnection.<.ctor>b__3_0() [0x00000] in <d05dc2e6bd2a40acab42430b347d4724>:0 
    at System.Threading.Tasks.Task`1[TResult].InnerInvoke() [0x00012] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:680 
    at System.Threading.Tasks.Task.Execute() [0x00016] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502 
    --- End of inner exception stack trace --- 
    at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2157 
    at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00052] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:3189 
    at System.Threading.Tasks.Task.Wait() [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:3054 
    at Neo4j.Driver.Internal.Connector.SocketConnection..ctor (Neo4j.Driver.Internal.Connector.ISocketClient socketClient, Neo4j.Driver.V1.IAuthToken authToken, Neo4j.Driver.V1.ILogger logger, Neo4j.Driver.Internal.Messaging.IMessageResponseHandler messageResponseHandler) [0x00046] in <d05dc2e6bd2a40acab42430b347d4724>:0 
    at Neo4j.Driver.Internal.Connector.SocketConnection..ctor (System.Uri url, Neo4j.Driver.V1.IAuthToken authToken, Neo4j.Driver.V1.Config config) [0x00016] in <d05dc2e6bd2a40acab42430b347d4724>:0 
    at Neo4j.Driver.Internal.Session..ctor (System.Uri uri, Neo4j.Driver.V1.IAuthToken authToken, Neo4j.Driver.V1.Config config, Neo4j.Driver.Internal.Connector.IConnection conn, System.Action`1[T] releaseAction) [0x0005c] in <d05dc2e6bd2a40acab42430b347d4724>:0 
    at Neo4j.Driver.Internal.SessionPool.<GetSession>b__14_0() [0x0003b] in <d05dc2e6bd2a40acab42430b347d4724>:0 
    at Neo4j.Driver.Internal.LoggerBase.TryExecute[T] (System.Func`1[TResult] func) [0x00000] in <d05dc2e6bd2a40acab42430b347d4724>:0 

私はのNeo4jマニュアル(http://neo4j.com/docs/operations-manual/current/)を介して見ていると、オンラインで検索しようとしたが、解決策を見つけることができませんでした。

答えて

1

最新のNeo4jドライバを見れば: https://www.nuget.org/packages/Neo4j.Driver/1.0.2

あなたはそれがrda.SocketsForPCLへの依存性(> = 1.2.2)が表示されます

のNeo4jを呼び出すようにしようとしている方法があります最新rda.SocketsForPCLで変更: https://www.nuget.org/packages/rda.SocketsForPCL/2.0.2

開発者のコ​​メントは以下のとおりです。

TcpSocketClient 's ConnectAsync method optionally takes a CancellationToken to support client-invoked cancellation and scenarios like timeout. Thanks @SparkStream

あなたのエラーは、次のとおりです。

Method 'Sockets.Plugin.Abstractions.ITcpSocketClient.ConnectAsync' not found.

ソリューションは、次のとおりです。

は(間違いなく作品など1.2.2、)rda.SocketsForPCLの以前のバージョンを選択して、問題が消えます。例えば

あなたはNuGetのためpaket依存性マネージャを使用している場合、あなたはあなたのpaket.dependenciesファイルに以下を追加することができます。

nuget rda.SocketsForPCL ~> 1 

幸運!

+0

ありがとうございました!これは問題を解決しました。私はその後、 "bolt:// localhost"を "bolt://127.0.0.1:7687"に変更するだけで、すべてが正常に動作するようになりました –

関連する問題