簡體   English   中英

發布帶有計划錯誤的Azure Webjob

[英]Publish Azure Webjob with Schedule error

我在發布具有VS 2013計划的Webjob時遇到問題。我可以發布“按需”作業,沒有問題,但我希望使用計划表。

這是我在下面遇到的錯誤。

發布時似乎找不到Microsoft.Web.WebJobs.Publish.Tasks.CreateScheduledWebJob。

我已盡一切努力嘗試對它進行排序,甚至將VS2013更新至版本3,添加了Nuget程序包,Azure SDK,發布SDK,Azure Scheduler管理庫,Azure服務管理庫和Azure公共庫。

我使用不同的方法創建了新的WebJob項目,

  1. 右鍵單擊解決方案->添加新項目->雲-> Microsoft Azure WebJob
  2. 右鍵單擊解決方案->添加新項目-> Windows桌面->控制台應用程序
  3. 右鍵單擊網站->添加->新Azure Webjob項目

C:\\ Development \\ dependencies \\ Microsoft.Web.WebJobs.Publish.1.0.0 \\ tools \\ webjobs.console.targets(80,5):錯誤MSB4061:“ Microsoft.Web.WebJobs.Publish.Tasks.CreateScheduledWebJob”任務無法從“ C:\\ Users \\ Tony \\ AppData \\ Local \\ assembly \\ dl3 \\ XDNO1P6L.QON \\ HEVOMEZ0.AYO \\ 587c592f \\ a99a921c_5eeacf01 \\ Microsoft.Web.WebJobs.Publish.Tasks.dll”中實例化。

 System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.WindowsAzure.Management.Scheduler, Version=1.0.0.0, 

文化=中性,PublicKeyToken = 31bf3856ad364e35'或其依賴項之一。 該系統找不到指定的文件。 文件名:System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly程序集,ObjectHandleOnStack retTypes)在System.Reflection.RuntimeAssembly(GetExported.GetExportedTypes,版本= 1.0.0.0,文化=中立,PublicKeyToken = 31bf3856ad364e35) )Microsoft.Build.Shared.TypeLoader.AssemblyInfoToLoadedTypes.ScanAssemblyForPublicTypes()處Microsoft.Build.Shared.TypeLoader.AssemblyInfoToLoadedTypes.ScanAssemblyForPublicTypes() ,位於Microsoft.Build.CommandLine.OutOfProcTaskAppDomainWrapperBase.ExecuteTask(IBuildEngine oopTaskHostNode,String taskName,String taskLocation,String taskFile,Int32 taskLine,Int32 taskColumn,AppDomainSetup,appDomainSetup,IDictionary2 taskParams)的String typeName,AssemblyLoadInfo程序集)

在我的案例中,webjob項目中引用了Microsoft.WindowsAzure.Management.Scheduler版本3.0.0.0,但是日志報告缺少版本1.0.0.0。 將以下行添加到webjob項目的App.config中解決了發布問題:

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.WindowsAzure.Management.Scheduler" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>
</assemblyBinding>
</runtime>

該部分可以添加到標簽內的某處。

請再給我一張與您的問題無關的紙條。 發布預定的網絡作業時,我了解到可用的重復頻率取決於網站配置。 在免費計划下,我無法在1天后使用重復頻率(要按照我的計划計划的標准進行調整)。 免費計划顯然僅支持1天的重復(撰寫本文的時間)。

希望這能進一步幫助。

我在其中添加了內容,並嘗試通過使用右鍵單擊項目並選擇添加->新Azure WebJob項目來創建新的Webjob,並得到了相同的結果

也許您可以回避整個問題,而只使用TimerTrigger進行調度? 確保將其部署為觸發的WebJob。

暫無
暫無

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

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