question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azure Functions giving exception while loading Dependency Dlls

See original GitHub issue

Repro steps

Provide the steps required to reproduce the problem

  1. Create a custom assembly custom dll (domain.dll)
  2. Custom dll should internally has a dependency on LinqKit
  3. Add the LinqKit refrence to nuget packages

Expected behavior

The function should work fine and the dependent dll should be loaded in the runtime.

Actual behavior

Get Exception at Runtime :

Message: Could not load file or assembly 'LinqKit, Version=1.1.7.2, Culture=neutral, PublicKeyToken=bc217f8844052a91' or one of its dependencies. The system cannot find the file specified., Stack Trace:    at Marketware.Domain.Centric.Segments.SegmentDefinition.SegmentDefinitions.CreateEncounterFilterExpressionForDate(String segmentFilterJson)
   at Marketware.Domain.Centric.Segments.SegmentDefinition.SegmentDefinitions.EncounterFilterDefinitionTuple(String filterString)
   at Marketware.Domain.Centric.Segments.SegmentDefinition.Services.SegmentDefinitionService.GetEncounterFilterDefinition(String filterString)
   at Submission#0.AddUpdateSegmentDefinitions(String databaseName, TraceWriter log, String audienceType, Guid segmentId, String filter, ISegmentDefinitionService segmentDefinitionService) in D:\home\site\wwwroot\SegmentProcessorHandler\run.csx:line 160
   at Submission#0.<LoadSegmentDefinitions>d__8.MoveNext() in D:\home\site\wwwroot\SegmentProcessorHandler\run.csx:line 146
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Submission#0.<Run>d__7.MoveNext() in D:\home\site\wwwroot\SegmentProcessorHandler\run.csx:line 78, Source: Marketware.Domain, Inner Exception:
2016-09-22T10:02:49.389 Function completed (Success, Id=2e708a21-262b-49a7-8cc5-5c741f7426b0)
2016-09-22T10:02:49.389 , Message: Could not load file or assembly 'LinqKit, Version=1.1.7.2, Culture=neutral, PublicKeyToken=bc217f8844052a91' or one of its dependencies. The system cannot find the file specified., Stack Trace:    at Marketware.Domain.Centric.Segments.SegmentDefinition.SegmentDefinitions.CreateEncounterFilterExpressionForDate(String segmentFilterJson)
   at Marketware.Domain.Centric.Segments.SegmentDefinition.SegmentDefinitions.EncounterFilterDefinitionTuple(String filterString)
   at Marketware.Domain.Centric.Segments.SegmentDefinition.Services.SegmentDefinitionService.GetEncounterFilterDefinition(String filterString)
   at Submission#0.AddUpdateSegmentDefinitions(String databaseName, TraceWriter log, String audienceType, Guid segmentId, String filter, ISegmentDefinitionService segmentDefinitionService) in D:\home\site\wwwroot\SegmentProcessorHandler\run.csx:line 160
   at Submission#0.<LoadSegmentDefinitions>d__8.MoveNext() in D:\home\site\wwwroot\SegmentProcessorHandler\run.csx:line 146
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Submission#0.<Run>d__7.MoveNext() in

Known workarounds

NA

Related information

NA

  • Programming language used
  • Links to source

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:28 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
akhilajcommented, Sep 23, 2016

Yes we are using version 0.5 of runtime

Function.json

{
  "bindings": [
    {
      "name": "message",
      "type": "serviceBusTrigger",
      "direction": "in",
      "queueName": "segmentprocessor",
      "connection": "MarketwareListener",
      "accessRights": "Listen"
    }
  ],
  "disabled": false
}

Framework.json

{
  "frameworks": {
    "net46":{
      "dependencies": {
        "EntityFramework": "6.1.3",
        "Newtonsoft.Json": "9.0.1",
         "LinqKit": "1.1.7.2"
      }
    }
   }
}
0reactions
dcarr42commented, Jan 18, 2017

I had to add a separate ref inside ExcelComponents.Reader.EPPlus to stop the runtime error.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Functions giving exception while loading ...
We have an Azure function which uses our custom dll (domain.dll), our dll internally has a dependency on LinqKit so we added the...
Read more >
Azure Functions giving exception while ... - appsloveworld.com
Coding example for the question Azure Functions giving exception while loading Dependency Dlls.
Read more >
Bring dependencies and third-party libraries to Azure ...
One of the simplest ways to bring in dependencies is to put the files/artifact together with the functions app code in Functions project ......
Read more >
Authenticating Azure AD Function fails with "Could not load ...
Verify that the required assembly is deployed to the Azure Function App. You can check the "Dependencies" section in the Azure portal for...
Read more >
Use dependency injection in .NET Azure Functions
There are differences in how you override dependencies and how configuration values are read with Azure Functions on the Consumption plan.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found