Publish as Azure WebJob not working in VS 2013

2020-04-10 04:44发布

问题:

I'm trying to publish a Azure website along with some azure webjobs using Visual Studio 2013. I'm following this tutorial.

My solution has the following structure:

When I try to add an existing project as a webjob to my Web project I get a blank dropdown in the Project Name options and I can't:

If I try to add each webjob individually I also have an error:

In this link it looks like they had a similar problem and the issue due to the fact that the webjobs are under a solution folder. There's no answer/solution to the problem in that thread though.

I was wondering if there's a solution/workaround to this since I don't want to get rid of the solution folders in my project to keep it organized and deploying the webjobs manually is really tedious.

Update: Here's a screenshot of a new project and the Add Azure Webjob doesn't work with Solution Folders.

回答1:

Expand Properties in the solution explorer... and make sure you have a file called "webjob-publish-settings" with the json content:

{
  "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
  "webJobName": "[put the name of your webjob here]",
  "startTime": null,
  "endTime": null,
  "jobRecurrenceFrequency": null,
  "interval": null,
  "runMode": "Continuous"
}


回答2:

Installing azure sdk2.5 or above should solve this problem: http://azure.microsoft.com/en-us/downloads/archive-net-downloads/