2017-03-23 35 views
0

當我在.csx文件中嘗試導入Azure Data Lake SDK的某些自定義dll時,出現以下錯誤。下面的錯誤是:Azure函數Azure Data Lake的自定義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 

我的項目結構如下:

enter image description here

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" 
      } 
     } 
    } 
} 

回答

1

即使你引用的CSX文件是在子文件夾中,引用是相對於功能文件夾的,因此您不想使用#r "..\bin\assembly.dll",而是僅使用#r "assembly.dll"

對於您的NuGet包,您打算使用的所有引用都必須在net46框架下,否則它們將不會被您的函數使用(直到僅針對該框架)。

我希望這有助於!

+0

它確實解決了我的問題,謝謝! –

相關問題