Unable to find FSharp.Core assembly when running AzureFunction

3

I am trying to follow the following blog post about how to set up a simple f# azure function. I am using Azure Functions version 2.

Everything builds and can be published, but I am running into an issue when running the code:

[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'.

I found this https://github.com/Microsoft/visualfsharp/issues/4263 which mentions that there is some bundled version of FSharp.Core in azure functions that version which conflicts with the one I use to compile it. Is there a workaround?

azure
f#
azure-functions
asked on Stack Overflow Mar 29, 2018 by Emil H • edited Apr 3, 2018 by Janusz Nowak

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0