簡體   English   中英

天藍色函數中的Microsoft.WindowsAzure.Storage.dll版本不匹配錯誤

[英]Microsoft.WindowsAzure.Storage.dll version mismatch error in azure functions

我正在使用一個dll(MyApp.dll),它通過nuget引用azure storage dll版本7.2.1。 我已經使用“WindowsAzure.Storage”:“7.2.1”將project.json文件添加到我的azure函數中。 我還將Microsoft.WindowsAzure.Storage上傳到bin \\目錄。 我的run.csx文件只有“new MyApp.Run(req)”。

我得到以下關於丟失dll的錯誤,我還能在我的azure函數中更改以解決此錯誤嗎? 我可以在本地使用MyApp.dll。

''的類型初始值設定項引發了異常。 無法加載文件或程序集“Microsoft.WindowsAzure.Storage,Version = 8.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”或其依賴項之一。 定位的程序集的清單定義與程序集引用不匹配。 (HRESULT異常:0x80131040)。

您是否在project.json中自己引用了WindowsAzure.Storage? 你不應該,因為環境已經為你引用了一個。 您應該使用#r來引用這個:

#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Blob;

這只是在你的函數本身中設置的。

docs.microsoft.com/en-us/azure/azure-functions/functions-reference-csharp#referencing-external-assemblies

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM