I am trying to create an Azure function, which takes an url and then returns a screenshot of the page. I have added the package CefSharp.OffScreen.NETCore to the project and the code from CefSharp.MinimalExample for generating a screenshot. Running this in a simple Core console application works as intended, but when run as an Azure Function i get the following error:
System.Private.CoreLib: Exception while executing function: HttpExample. CefSharp.Core: Could not load file or assembly 'CefSharp.Core.Runtime, Version=18.104.22.168, Culture=neutral, PublicKeyToken=40c4b6fc221f4138'. An attempt was made to load a program with an incorrect format. System.Private.CoreLib: An attempt was made to load a program with an incorrect format. (0x8007000B).
Sorry I didn't reproduce your issue. As far as I know, Azure Function runs on 32 bit OS, which might not match your assembly.
As you said, your project works well on locally, please check the differences between your local environment and Function App's environment.
User contributions licensed under CC BY-SA 3.0