Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions Shared DLLs in root /bin not found

Based on the documentation and a response I got on the MS forums.

I should be able to reference my own libraries in a root bin folder in my Azure Functions App. I will be sharing these libraries between multiple functions.

Here is the relevant part of my code:

#r "../bin/AquasolConnect.Connector.dll"
#r "../bin/AquasolConnect.TankLinkConnector.dll"

using System;
using AquasolConnect.Connector;
using AquasolConnect.TankLinkConnector;

public static void Run(TimerInfo GetTankReadingsTimer, TraceWriter log)

Here is my folder structure:

  • root
    • bin
      • AquasolConnect.Connector.dll
      • AquasolConnect.TankLinkConnector.dll
    • GetTankReadings
      • functions.json
      • run.csx

Here is what the log says:

2016-04-22T11:44:56.914 (1,1): error CS0006: Metadata file '../bin/AquasolConnect.Connector.dll' could not be found

2016-04-22T11:44:56.914 (2,1): error CS0006: Metadata file '../bin/AquasolConnect.TankLinkConnector.dll' could not be found

2016-04-22T11:44:56.914 (5,7): error CS0246: The type or namespace name 'AquasolConnect' could not be found (are you missing a using directive or an assembly reference?)

2016-04-22T11:44:56.914 (6,7): error CS0246: The type or namespace name 'AquasolConnect' could not be found (are you missing a using directive or an assembly reference?)

What am I doing wrong?

like image 706
Andrew Hawes Avatar asked Apr 22 '16 12:04

Andrew Hawes


1 Answers

I was able to get the function to compile, but only by using the full file reference.

#r "D:\home\site\wwwroot\bin\AquasolConnect.Connector.dll"  
#r "D:\home\site\wwwroot\bin\AquasolConnect.TankLinkConnector.dll" 

But then when the function ran I got:

Unable to find assembly 'AquasolConnect.TankLinkConnector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Are you missing a private assembly file?

Better answers anyone?

like image 142
Andrew Hawes Avatar answered Sep 22 '22 17:09

Andrew Hawes