Microsoft Azure関数内でMicrosoft.Azure.SqlDatabase.ElasticScale.Clientパッケージを使用します。Azure関数内でElastic Scaleパッケージを使用します。
次のように私はproject.jsonを追加しました:
{
"frameworks": {
"net452":{
"dependencies": {
"Microsoft.Azure.SqlDatabase.ElasticScale.Client": "1.3.3"
}
}
}
}
は機能:
#r "System.Data"
#r "Newtonsoft.Json"
using System.Net;
using Newtonsoft.Json;
using System.Data.SqlClient;
using Microsoft.Azure.SqlDatabase.ElasticScale.ShardManagement;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
ShardMapManager shardMapManager;
return req.CreateResponse(HttpStatusCode.OK);
}
私は次のエラーを取得:
error CS0234: The type or namespace name 'SqlDatabase' does not exist in the namespace 'Microsoft.Azure' (are you missing an assembly reference?)
error CS0246: The type or namespace name 'ShardMapManager' could not be found (are you missing a using directive or an assembly reference?)
これはgretaのヘルプです。 "reference external assembly"リンクは答えました:私はproject.json内でnet452をnet46に変更する必要がありました。その後、正常に動作しました。アセンブリを明示的に参照する必要はありませんでした。コンパイルされたバイナリのリンクをありがとう、それははるかに良い長期計画に見えます。 – SpecWin
プリコンパイルされたバイナリに変換され、うまくいきます。再度、感謝します – SpecWin