Azure 함수에서 테이블 저장소의 데이터를 읽는 중입니다. 테이블 스토리지 바인딩에서 HttpTrigger 함수를 만들었습니다. 프로젝트 저장 패키지를 사용하고 있습니다 :Azure 함수 테이블 바인딩의 저장소가 매개 변수 'TElement'형식의 제약 조건을 위반합니다.
"WindowsAzure.Storage": "8.0.0"
및 바인딩 :
{
"bindings": [
{
"authLevel": "anonymous",
"name": "req",
"type": "httpTrigger",
"direction": "in"
},
{
"name": "$return",
"type": "http",
"direction": "out"
},
{
"name": "metadataTable",
"type": "table",
"direction": "in",
"tableName": "metadata",
"connection": "StorageConnectionString",
"partitionkey": "some_partition_key"
}
],
"disabled": false
}
내가 매개 변수에 새로 추가 한 템플릿에 의해 생성 된 코드를 가졌 : 나는 무엇입니까 저장하고 실행 과정에서
#r "Microsoft.WindowsAzure.Storage"
using System;
using System.Net;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.WindowsAzure.Storage;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req,
IQueryable<MetadataTable> metadataTable, TraceWriter log)
{
.....
}
public class MetadataTable: TableEntity
{
public MetadataTable():base() { }
public MetadataTable(string partitionkey, string rowkey):base(partitionkey,rowkey) {}
public string Data { get; set; }
}
컴파일 오류 :
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.HttpTriggerCSharp1'. Microsoft.Azure.WebJobs.Host: GenericArguments[0], 'Submission#0+MetadataTable', on 'Microsoft.Azure.WebJobs.Host.Tables.TableAttributeBindingProvider+TableToIQueryableConverter
1[TElement]' violates the constraint of type 'TElement'. mscorlib: GenericArguments[0], 'Submission#0+MetadataTable', on 'Microsoft.Azure.WebJobs.Host.Tables.TableAttributeBindingProvider+TableToIQueryableConverter
1[TElement]' violates the constraint of type parameter 'TElement'.
누구든지이 문제를 해결하거나 동일한 오류를 만날 수 있습니까?
Mikhail에게 감사드립니다. Azure 함수 호스팅 환경 (Newtonsoft.Json, Microsoft.WindowsAzure.Storage 등)에 의해 자동으로 추가되는 어셈블리에 대한 특정 버전을 어떻게 설정할 수 있습니까? – Leszek
아니요, 그러한 가능성을 알지 못합니다. – Mikhail
Visual Studio 2017에서 만든 function app에 project.json 또는 WindowsAzure.Storage에 대한 참조가있는 것과 동일한 문제가 있습니다. [31/08/2017 12:49:20] 실행 : Microsoft.Azure.WebJobs.Host : 인덱싱 방법 'SearchTrucks.Run'오류가 발생했습니다. Microsoft.Azure.WebJobs.Host : 'Microsoft.Azure.WebJobs.Host.Tables.TableExtension + TableToIQueryableConverter'1 [TElement]의 GenericArguments [0],'NNN.NNN.NNN '이'TElement '유형의 제약 조건을 위반합니다. . mscorlib : –