2

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

2 Answers 2

1

Hmmm. This does seem very much like there's a deployment issue in that the MBrace.FsPickler assembly isn't available. I know you it in the post, but are you 100% sure that the assembly is in the same folder as the function assembly?

Does it run locally on the Functions runtime / debugger? What version of F# are you running?

Sign up to request clarification or add additional context in comments.

7 Comments

FsPickler.dll is in the function's root, just like PSlogger.dll. The target runtime for the function and PSlogger is FSharp.Core 4.4.1.0, and FSharp.Core.dll is also in the root. The compiled function as well as PSlogger.dll target .NET Framework 4.7. And the function assembly is in the root. When I refer to the root, I mean the compiled function root, not the function app root. While I have been able to get the function's local debugger to start in VS 2017 15.4.4, I have not figured out how to trigger a timer event so I can actually run and debug locally.
You can call "func run <name of function>" to trigger Timer Triggers manually when running locally. (Works for all triggers, actually)
Yeah, try debugging locally and grab some screenshots of your file structure. I'll probably need a repro to debug if you can provide one.
Problems getting func run to work as well. Pushed project to github.com/jackfoxy/TibruFunctions and documented problems in readme.
I've seen that error from the readme before, but only when my webjobs were declared in a module within a module? This renders in IL as a nested class, which the Azure WebJobs SDK can't find using the standard Functions (WebJob) locator. Changing to a top-level module fixed it for me.
|
1

The problem is Azure functions cannot support the FsPickler.dll, either because the DLL is built for .NET Framework 4.5, or because System.Tuple has changed underneath FsPickler. See discussion here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.