という Azure 関数を実行していSmsWebhook
ます。AzureFunctionsSample.Services.dll
への参照を持つ外部アセンブリのメソッドを呼び出しますNewtonsoft.Json 8.0.3
私の詳細はRun.csx
次のようになります。
#r "AzureFunctionsSample.Services.dll"
using System.Net;
using AzureFunctionsSample.Services
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
...
}
上記のメソッド内でRun()
、インスタンスを作成し、インスタンス内のメソッドを呼び出します。ただし、そのメソッドを呼び出すたびに、次のエラーが表示されます。
2016-05-19T13:41:45 Welcome, you are now connected to log-streaming service.
2016-05-19T13:41:46.878 Function started (Id=64fccf0c-d0ef-45ef-ac1c-7736adc94566)
2016-05-19T13:41:46.878 C# HTTP trigger function processed a request. RequestUri=https://ase-dev-fn-demo.azurewebsites.net/api/smswebhook
2016-05-19T13:41:46.878 Function completed (Failure, Id=64fccf0c-d0ef-45ef-ac1c-7736adc94566)
2016-05-19T13:41:46.894 Exception while executing function: Functions.SmsWebhook. Microsoft.Azure.WebJobs.Script: One or more errors occurred. AzureFunctionsSample.Services: Could not load file or assembly 'Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040).
Newtonsoft.Json.dll
ディレクトリの下に同じバージョンの を手動で追加しましたbin
が、それでも同じエラーが発生しました。Newtonsoft.Json.dll
ファイルで文句を言っているのはなぜですか?
ちなみに、外部アセンブリ内のすべてのロジックを に移動するRun.csx
と、問題は発生しません。