我编译的 Azure 函数在 DLL 中找不到由我的函数调用的 DLL 调用的方法。
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()
...
所有必需的 DLL 均已存在。方法是存在的。我还为子 DLL 添加了一条 open 语句。
代码:
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
最佳答案
嗯。这看起来确实很像存在部署问题,因为 MBrace.FsPickler 程序集不可用。我在帖子中知道您的情况,但是您是否 100% 确定该程序集与函数程序集位于同一文件夹中?
它是否在函数运行时/调试器上本地运行? 您运行的是哪个版本的 F#?
关于azure - 已编译的 Azure 函数,FunctionInitationException : Method not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47383091/