none
Function app : Could not load the specified file RRS feed

  • Question

  • <log-content _nghost-c34="">
    Hello,

    I developped a simple c# project (library net core) in VS2019 with a nuget package (SSH.NET), 
    which corresponds to Renci.SshNet.dll  

    I could test the result called VSsftpclassnetcore.dll 
    by delopping in visual studio an application calling this ddl and its ok

    Now I need to use this ddl on azure fo a funtion app.
    But I always get this error :

    [Error] Executed 'Functions.HttpTrigger1' (Failed, Id=7aba035c-e7ee-4683-9d6c-7fed825b83b1)
    Could not load the specified file.

    I'm not sure about this very generic error message 
    but perhaps there is a problem to load the dll file  

    I'm comuing from Dynamics nav, and am new to azure and c#
    I need to understand how to use SSH.NET in an azure function app.

    Thanks


    </log-content>
    Monday, August 5, 2019 10:57 PM

All replies

  • Try changing the bitness of the function app to 64 bit on the Configuration blade of the function app. That module may require a certain bitness to run. 

    Tuesday, August 6, 2019 1:39 AM
  • thanks - i tried but no change :(
    Tuesday, August 6, 2019 8:40 PM
  • Can you create a basic app that uses that functionality and share a repro using something like github or bitbucket?
    Tuesday, August 6, 2019 9:05 PM
  • let me give you some screenshots to let you see in detail what I tried :

    This is the dll I developped in VS2019 :


    Build of dll :

    1>------ Début de la génération : Projet : VSsftpclassnetcore, Configuration : Debug Any CPU ------
    1>VSsftpclassnetcore -> C:\...\source\repos\VSsftpclassnetcore\VSsftpclassnetcore\bin\Debug\netcoreapp2.1\VSsftpclassnetcore.dll
    ========== Génération : 1 a réussi, 0 a échoué, 0 mis à jour, 0 a été ignoré ==========

    This dll can be used successfull in a VS project but this does not work on Azure Function App :

    Thursday, August 8, 2019 6:23 PM
  • So I think the issue here is that your Dll is compiled for dotnet standard and Azure Functions 2.0 does not support donet standard at this point. Try changing the runtime version to ~1 (see below).

    App Setting
    https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#functions_extension_version 

    Tracking dotnet standard support in V2
    https://github.com/Azure/Azure-Functions/issues/790

    Friday, August 9, 2019 4:00 AM
  • <log-content _nghost-c36="">
    Thanks for the answer - I changed the value to ~1 and I get this error on run :
    2019-08-10T20:32:43.119 [Info] Function started (Id=7c00dedb-1079-4d71-acba-bd36f1957a50)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] Function compilation error
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(5,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(6,28): error CS0234: The type or namespace name 'Primitives' does not exist in the namespace 'Microsoft.Extensions' (are you missing an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(10,45): error CS0246: The type or namespace name 'HttpRequest' could not be found (are you missing a using directive or an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(10,26): error CS0246: The type or namespace name 'IActionResult' could not be found (are you missing a using directive or an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(27,29): error CS0246: The type or namespace name 'OkObjectResult' could not be found (are you missing a using directive or an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(27,12): error CS0246: The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.399 [Error] run.csx(28,15): error CS0246: The type or namespace name 'BadRequestObjectResult' could not be found (are you missing a using directive or an assembly reference?)
    </log-content><log-content _nghost-c36="">
    2019-08-10T20:32:43.571 [Error] Exception while executing function: Functions.HttpTrigger1. Microsoft.Azure.WebJobs.Script: Script compilation failed.
    </log-content><log-content _nghost-c36="">

    2019-08-10T20:32:43.618 [Error] Function completed (Failure, Id=7c00dedb-1079-4d71-acba-bd36f1957a50, Duration=458ms)


    </log-content>
    Saturday, August 10, 2019 8:40 PM
  • Hi grennert,

    Any luck later?

    I have same 'Could not load the specified file.' error.

    I can see the highest version of SSH.NET.2016.1.0 package is netstandard1.3.

    Should we need the .net standard 2.0?

    Regards,

    Zhenyu

    Tuesday, September 17, 2019 4:06 AM
  • I missed the reply earlier. Try creating a brand new V1 function app in VS with your code and see if that gives the same exception. 
    Saturday, September 21, 2019 2:30 AM