CosmosDBグラフに接続するAzure関数を作成しました。私は、Microsoft.Azure.Graph 0.3.0プレビューのnugetパッケージを使用しています。私が関数の終点に達したときにエラーが発生しています。ファイルまたはアセンブリ 'Microsoft.Azure.Graphs'を読み込めませんでした
Exception while executing function: GetTrain -> Could not load file or assembly 'Microsoft.Azure.Graphs, Version=0.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
関数のコードは以下ですが、それも限りと取得していません。
[FunctionName("GetThing")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "thing/{id}")]HttpRequestMessage req, string id, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
string endpoint = ConfigurationManager.AppSettings["endpoint"];
string authKey = ConfigurationManager.AppSettings["authkey"];
string db = ConfigurationManager.AppSettings["db"];
string collection = ConfigurationManager.AppSettings["collection"];
DocumentClient client = new DocumentClient(new Uri(endpoint), authKey,
new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp });
DocumentCollection graph = await client.CreateDocumentCollectionIfNotExistsAsync(
UriFactory.CreateDatabaseUri(db),
new DocumentCollection { Id = collection },
new RequestOptions { OfferThroughput = 1000 });
IDocumentQuery<dynamic> query = client.CreateGremlinQuery<dynamic>(graph, $"g.V('{id}').has('thing')");
// Fetching the name from the path parameter in the request URL
return req.CreateResponse(HttpStatusCode.OK, "Hello");
}
更新
は完全にそれを見ていない、ビルド警告があるようです。何かご意見は?警告は、「MSIL」を建設中プロジェクトのプロセッサアーキテクチャおよびC」参照のプロセッサアーキテクチャの間に不一致があったMSB3270
:\ユーザーは\ blah.nugetパッケージ\ \ microsoft.azure.graphs 0.3 \ .0 - プレビュー\ lib \ net461 \ Microsoft.Azure.Graphs.dll "、" AMD64 "。この不一致は、実行時の障害を引き起こす可能性があります。構成マネージャーを使用してプロジェクトの対象プロセッサーアーキテクチャーを変更して、プロジェクトと参照の間でプロセッサーのアーキテクチャーを調整するか、プロジェクトの対象プロセッサーアーキテクチャーと一致するプロセッサーアーキテクチャーを参照に依存させることを検討してください。
また私の側でそれを再現することができました。私たちは[feedback](https://github.com/Azure/Azure-Functions/issues)をazure関数チームに与えることができます –
コンパイル時の警告はありますか? –
はい、警告付きで更新されました –