c# - 未在 root/bin 中找到 Azure Functions 共享 DLL

标签 c# azure dll azure-functions

基于documentation和一个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)

这是我的文件夹结构:

    • 垃圾箱
      • AquasolConnect.Connector.dll
      • AquasolConnect.TankLinkConnector.dll
    • 获取坦克读数
      • functions.json
      • 运行.csx

日志内容如下:

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?

谁有更好的答案?

关于c# - 未在 root/bin 中找到 Azure Functions 共享 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36793473/

相关文章:

c# - Entity Framework 多对象上下文

azure - 电影 : importing audio from text-to-speech in memory

c# - 自动将 native dll复制到Visual Studio中引用项目的bin文件夹中

c# - 来自 httpResponse.end() 的缓冲输出?

c# - 属性错误: An attribute argument must be a constant expression, 属性参数类型的typeof表达式或数组创建表达式

azure - 使用托管服务标识对 Azure Function 进行授权以从 Azure 存储容器获取 blob

dll 没有有效的 clr header ,无法反汇编

c - 如何链接 C 包以便在程序中使用它们?

c# - explain x => x.ToString()//简化这么多调用

c# - StackExchange.Redis 与 Azure Redis 速度慢得无法使用或引发超时错误