Reputation: 21
I am having an issue with publishing a Webjob with a schedule from VS 2013. I can publish an "on demand" job no problems but I want it with a schedule.
Here is the error I am getting below..
It looks like it cannot find the Microsoft.Web.WebJobs.Publish.Tasks.CreateScheduledWebJob when publishing.
I have done everything to try sort it even updated VS2013 to version 3, added the Nuget Packages, Azure SDK, the publishing SDK, the Azure Scheduler Management Library, the Azure Service Management Library & the Azure Common Library.
I have created new WebJob projects using different methods,
C:\Development\dependencies\Microsoft.Web.WebJobs.Publish.1.0.0\tools\webjobs.console.targets(80,5): Error MSB4061: The "Microsoft.Web.WebJobs.Publish.Tasks.CreateScheduledWebJob" task could not be instantiated from "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,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.WindowsAzure.Management.Scheduler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at Microsoft.Build.Shared.TypeLoader.AssemblyInfoToLoadedTypes.ScanAssemblyForPublicTypes() at Microsoft.Build.Shared.TypeLoader.AssemblyInfoToLoadedTypes.GetLoadedTypeByTypeName(String typeName) at Microsoft.Build.Shared.TypeLoader.GetLoadedType(Object cacheLock, Object loadInfoToTypeLock, ConcurrentDictionary2 cache, String typeName, AssemblyLoadInfo assembly) at Microsoft.Build.CommandLine.OutOfProcTaskAppDomainWrapperBase.ExecuteTask(IBuildEngine oopTaskHostNode, String taskName, String taskLocation, String taskFile, Int32 taskLine, Int32 taskColumn, AppDomainSetup appDomainSetup, IDictionary2 taskParams)
Upvotes: 2
Views: 885
Reputation: 7696
Perhaps you can sidestep this entire problem and just use a TimerTrigger for scheduling instead? Make sure to deploy as a triggered WebJob.
Upvotes: 0
Reputation: 11
I added that in and tried to created a new Webjob by using the right click project and choosing add -> New Azure WebJob project and got the same
Upvotes: 0
Reputation: 601
In my case the 'Microsoft.WindowsAzure.Management.Scheduler' version 3.0.0.0 was referenced in the webjob project but the log reported a missing version 1.0.0.0. Adding the following lines to the App.config of the webjob project solved the publishing issue:
<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>
The section can be added somewhere within the tag.
Please allow me one additional note which is not related to your question. While publishing the scheduled webjob I learned that the available recurrence frequency depends on the website configuration. I was not able to use a recurrence frequency bellow 1 day with the free plan (hat to scale to standard for my schedule plan). The free plan supports apparently only a 1 day recurrence (time of writing).
Hopes this helps further.
Upvotes: 0