I'm running an Azure Functions, called SmsWebhook
. It calls a method in an external assembly, AzureFunctionsSample.Services.dll
that has a reference to Newtonsoft.Json 8.0.3
The details of my Run.csx
looks like:
#r "AzureFunctionsSample.Services.dll"
using System.Net;
using AzureFunctionsSample.Services
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
...
}
Within the Run()
method above, I create an instance and call a method in the instance. However, whenever I call that method, I receive the following error:
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).
I manually added the same version of Newtonsoft.Json.dll
under the bin
directory, but still got the same error. Why is it complaining at the Newtonsoft.Json.dll
file?
If I move all the logics within the external assembly into the Run.csx
, it won't complain, by the way.