找不到 root /bin 中的 Azure Functions 共享 DLL

Azure Functions Shared DLLs in root /bin not found

基于 documentation and a response 我进入了 MS 论坛。

我应该能够在我的 Azure Functions 应用程序的根 bin 文件夹中引用我自己的库。我将在多个函数之间共享这些库。

这是我的代码的相关部分:

#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)

这是我的文件夹结构:

日志内容如下:

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?)

我做错了什么?

我能够编译函数,但只能使用完整的文件引用。

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

但是当函数 运行 我得到:

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

谁有更好的答案?

由于声誉不佳,我无法 post 发表评论,因此改为 'answer'。 我已将我的自定义 dll 放在与 Andrew 类似的文件夹结构的 bin 文件夹下。但随后面临同样的问题:

2016-06-28T10:13:24.804 Unable to find assembly 'FunctionPOCLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Are you missing a private assembly file?2016-06-28T10:13:24.804 Function completed (Failure, Id=ac19dc2b-b5f1-4ffe-a290-747266b83935)
2016-06-28T10:13:24.835 Exception while executing function: Functions.QueueTriggerCSharp1. mscorlib: Exception has been thrown by the target of an invocation. ƒ-QueueTriggerCSharp1#ℛ*35133685-d255-4835-8282-acb5c5d9fca5#9-0: Could not load file or assembly 'FunctionPOCLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

在我的代码中,我将输入值解析为在我的自定义程序集中定义的 POCO。

var rc  = Newtonsoft.Json.JsonConvert.DeserializeObject(myQueueItem);
log.Info(rc.PropGuid.ToString());

最终对我有用的是将 bin 文件夹与 run.csx 放在同一级别,然后在没有路径的情况下引用它,例如:

#r "MyAssembly.dll"