CosmosDB 그래프에 연결할 Azure 함수를 만들었습니다. 나는 nuget 패키지 인 Microsoft.Azure.Graph 0.3.0-preview를 사용하고 있으며 함수의 끝점에 도달하면 오류가 발생합니다.파일 또는 어셈블리 '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-preview \ lib \ net461 \ Microsoft.Azure.Graphs.dll ","AMD64 ". 이 불일치로 인해 런타임 오류가 발생할 수 있습니다. 프로젝트와 참조간에 프로세서 아키텍처를 정렬하거나 프로젝트의 대상 프로세서 아키텍처와 일치하는 프로세서 아키텍처로 참조에 종속되도록 Configuration Manager를 통해 프로젝트의 대상 프로세서 아키텍처를 변경하는 것을 고려하십시오.
나는 또한 내 의견을 재현 할 수있다. 우리는 [의견] (https://github.com/Azure/Azure-Functions/issues)을 하늘색 팀에 줄 수있다. –
컴파일 타임 경고가 있는가? –
예, 경고로 업데이트 됨 –