Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Could not load file or assembly...' error... possibly due to Dependent Package binaries not copied to 'bin'

Open alkreddy opened this issue 6 years ago • 2 comments

My Function App has references to the following packages. The local execution runtime doesn't find them resulting in Could not load file or assembly errors

  • System.IdentityModel.Tokens.Jwt 6.5.1
  • Microsoft.IdentityModel.Tokens 6.5.1

Investigative information

Local Execution Azure Functions Core Tools (3.0.2534 Commit hash: bc1e9efa8fa78dd1a138dd1ac1ebef97aac8d78e) Function Runtime Version: 3.0.13353.0

Repro steps

  1. Run the Function App Locally, the Host Starts Up fine.
  2. Invoke the function and notice the errors in output and console log.

Error Executed 'KSNavigation' (Failed, Id=0cc2793a-c137-4b48-a584-b5e31404f0d2) [21-05-2020 04:16:46] System.Private.CoreLib: Exception while executing function: KSNavigation. AVEVA.DataLake.Function: Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=6.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Expected behavior

Functions executes without Assembly Load Errors

Actual behavior

Function fails with the following error Executed 'KSNavigation' (Failed, Id=0cc2793a-c137-4b48-a584-b5e31404f0d2) [21-05-2020 04:16:46] System.Private.CoreLib: Exception while executing function: KSNavigation. AVEVA.DataLake.Function: Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=6.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Known workarounds

Was able to overcome this error by manually copying the dll to the bin folder but then I see it's dependent assembly failure error.

Related information

Provide any related information

  • Programming language used : C#
  • Links to source
  • Bindings used : HttpTrigger

alkreddy avatar May 21 '20 05:05 alkreddy

Was not sure if this is the right forum, so posted the same on https://github.com/Azure/azure-functions-host/issues/6070

alkreddy avatar May 21 '20 05:05 alkreddy

Hi @alkreddy , Closing the issue as resolved, In case of any further concerns regarding this issue, please feel free to re-open the issue.

v-bbalaiagar avatar Feb 23 '21 16:02 v-bbalaiagar