My compiled Azure function is not finding a method in a DLL called by a DLL my function calls.
Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.CompiledTrigger
---> System.AggregateException : One or more errors occurred.
---> Method not found: 'Void MBrace.FsPickler.BinarySerializer..ctor(Microsoft.FSharp.Core.FSharpOption`1<Boolean>, Microsoft.FSharp.Core.FSharpOption`1<MBrace.FsPickler.ITypeNameConverter>, Microsoft.FSharp.Core.FSharpOption`1<MBrace.FsPickler.IPicklerResolver>)'.
at Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetTaskResult(Task task)
at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 453
at Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.<>c.<InvokeCore>b__26_0(Task t)
at C:\projects\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 276
at System.Threading.Tasks.ContinuationResultTaskFromTask`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
...
All the necessary DLLs are present. The method exists. And I added an open statement for the sub DLL as well.
The code:
module Trigger
open System
open Microsoft.Azure.WebJobs
open Microsoft.Azure.WebJobs.Host
open Microsoft.Azure.WebJobs.Extensions
open PSlogger //this DLL is called
open MBrace.FsPickler //which calls this DLL
let logMessage (initLog : CountingLog) connString curretnProcess message addlInfo =
// fails inside this call, whether I use the async or non-async function
//IO.insertAsync connString {initLog.Log with
IO.insert connString {initLog.Log with
UtcTime = DateTime.UtcNow;
Process = curretnProcess
Message = message
StringInfo = addlInfo
} "MyLogPrefix"
let Run(myTimer: TimerInfo, log: TraceWriter ) =
async {
...
logMessage logger connString None "starting run" None |> ignore
...
} |> Async.StartAsTask