【问题标题】:Azure Functions Custom dlls for Azure Data LakeAzure Data Lake 的 Azure Functions 自定义 dll
【发布时间】:2017-03-23 19:10:14
【问题描述】:

尝试在我的 .csx 文件中导入一些用于 Azure Data Lake SDK 的自定义 dll 时出现以下错误。错误如下:

Function started (Id=1d6d553e-0ef5-45f2-bffb-dea4ad869424)

Function compilation error

D:\home\site\wwwroot\bigdataanalytics-azurefunction\ingestservices\NewsService.csx(2,1): warning AF006: The reference '..\bin\Microsoft.Rest.ClientRuntime.dll' is invalid. If you are attempting to add a framework reference, please remove the '.dll' file extension.

D:\home\site\wwwroot\bigdataanalytics-azurefunction\ingestservices\NewsService.csx(2,1): error CS0006: Metadata file '..\bin\Microsoft.Rest.ClientRuntime.dll' could not be found

D:\home\site\wwwroot\bigdataanalytics-azurefunction\ingestservices\NewsService.csx(3,1): error CS0006: Metadata file '..\bin\Microsoft.Rest.ClientRuntime.Azure.dll' could not be found

D:\home\site\wwwroot\bigdataanalytics-azurefunction\ingestservices\NewsService.csx(4,1): error CS0006: Metadata file '..\bin\Microsoft.Azure.Management.DataLake.Store.dll' could not be found

我的项目结构如下:

project.json 配置:

{
    "frameworks": {
        "net45": {
            "dependencies": {
                "Microsoft.Rest.ClientRuntime": "2.3.2",
                "Microsoft.Rest.ClientRuntime.Azure": "3.3.2",
                "Microsoft.Azure.Management.DataLake.Store": "1.0.4"
            }
        },
        "net46": {
            "dependencies": {
                "Newtonsoft.Json": "9.0.1",
                "System.Runtime.Serialization.Json": "4.3.0",
                "System.Net.Requests": "4.3.0"
            }
        }
    }
}

【问题讨论】:

    标签: azure azure-functions azure-data-lake


    【解决方案1】:

    即使您引用的 CSX 文件位于子文件夹中,但引用是相对于函数文件夹的,因此您不想使用 #r "..\bin\assembly.dll",而是只使用 #r "assembly.dll"

    对于您的 NuGet 包,您打算使用的所有引用都必须在 net46 框架下,否则它们将不会被您的函数使用(直到仅针对该框架)。

    我希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 2020-11-22
      • 2019-12-02
      • 2021-07-26
      • 1970-01-01
      • 1970-01-01
      • 2019-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多