簡體   English   中英

Webjob V3 未啟動:找不到方法:'Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer

[英]Webjob V3 not starting: Method not found: 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer

我有一個 V3 .NET webjob 沒有在我的本地機器上啟動。 我已經有一段時間沒有研究它了,但從那時起,在整個解決方案中更新軟件包時,我經歷了幾輪軟件包更新。 (沒有測試網絡作業,是的,我知道,我很愚蠢。)

這是 webjob 控制台的輸出:

fail: Host.Startup[0] The listener for function 'Functions.Run' was unable to start. Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener for function 'Functions.Run' was unable to start. ---> System.MissingMethodException: Method not found: 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer Microsoft.Azure.WebJobs.DistributedLockManagerContainerProvider.get_InternalContainer()'. at Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.get_TimerStatusDirectory() at Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.GetStatusBlobReference(String timerName) in C:\\azure-webjobs-sdk-extensions\\src\\WebJobs.Extensions\\Extensions\\Timers\\Scheduling\\StorageScheduleMonitor.cs:line 144 at Microsoft.Azure.WebJobs.Extensions.Timers.StorageScheduleMonitor.<GetStatusAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.Azure.WebJobs.Extensions.Timers.Listeners.TimerListener.<StartAsync>d__27.MoveNext() in C:\\azure-webjobs-sdk-extensions\\src\\WebJobs.Extensions\\Extensions\\Timers\\Listener\\TimerListener.cs:line 99 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Listeners.SingletonListener.<StartAsync>d__13.MoveNext() in C:\\projects\\azure-webjobs-sdk-rqm4t\\src\\Microsoft.Azure.WebJobs.Host\\Singleton\\SingletonListener.cs:line 70 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.<StartAsync>d__13.MoveNext() in C:\\projects\\azure-webjobs-sdk-rqm4t\\src\\Microsoft.Azure.WebJobs.Host\\Listeners\\FunctionListener.cs:line 68 --- End of inner exception stack trace ---

錯誤發生在這里:

IHost host = builder.Build();  

using (host)
{
    Run(); // Exception

我嘗試了很多不同的方法,但我什至不確定此錯誤消息的含義。 我認為它可能是存儲模擬器或新軟件包,但我不確定。

我仍然不知道到底出了什么問題,但顯然包升級破壞了一些東西。 新的 webjob 項目模板的結構與我正在使用並遇到問題的舊模板不同。

例如,在 Visual Studio 中,新項目具有依賴項,而不是 Properties、References 和 packages.config,其下有 Assemblies、Packages 和 Projects。 此外,當您在 Visual Studio 中雙擊新項目名稱時,它會打開 .csproj 文件。

我將舊的 webjob 項目的邏輯轉移到一個新的項目中,該項目顯然使用了最新的 webjob 模板。 您還可以在新模板中稍微不同地配置存儲字符串,例如Environment.SetEnvironmentVariable("AzureWebJobsDashboard", and Environment.SetEnvironmentVariable("AzureWebJobsStorage",

我的 webjob 現在正在工作,將邏輯移到新項目中並沒有花很長時間。

暫無
暫無

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

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