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:
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?
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With