运行AzureFunction时无法找到FSharp.Core程序集

时间:2018-03-29 10:33:57

标签: azure f# azure-functions

我正在尝试关注以下关于how to set up a simple f# azure function的博文。我正在使用Azure Functions版本2.

一切都在构建并且可以发布,但是在运行代码时遇到了一个问题:

[29/03/2018 10:27:00] Executing 'Functions.lofunc' (Reason='Timer fired at 2018-03-29T12:27:00.0084511+02:00', Id=fc30e93d-cae7-4f72-b9f9-adbc2f50794c)
[29/03/2018 10:27:00] Exception during runtime resolution of assembly 'FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a': 'System.InvalidCastException: [A]System.AppDomain cannot be cast to [B]System.AppDomain. Type A originates from 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' in the context 'Default' at location 'C:\Users\emilh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\System.Private.CoreLib.dll'. Type B originates from 'System.Runtime.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Users\emilh\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\System.Runtime.Extensions.dll'.
[29/03/2018 10:27:00]    at Microsoft.Azure.WebJobs.Script.Description.FunctionAssemblyLoader.ResolveAssembly(Object sender, ResolveEventArgs args) in C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\DotNet\FunctionAssemblyLoader.cs:line 69'
[29/03/2018 10:27:00] Unable to find assembly 'FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Are you missing a private assembly file?
[29/03/2018 10:27:00] A ScriptHost error has occurred
[29/03/2018 10:27:00] Exception while executing function: Functions.lofunc. System.Private.CoreLib: Exception has been thrown by the target of an invocation. lofunc: Could not load file or assembly 'FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

我发现这个https://github.com/Microsoft/visualfsharp/issues/4263提到在azure函数中有一些捆绑的FSharp.Core版本,这个版本与我用来编译它的版本冲突。有解决方法吗?

0 个答案:

没有答案