10

I just used the WebJob SDK to add a WebJob to my web app.

Now, when publishing the web app, VS is stuck when publishing (does not hang, but does not progress either).

I know it's caused by the WebJob because when I remove the webjobs-list.json, it publishes perfectly.

Weird thing is, publishing the WebJob alone (using Publish as Azure WebJob) does not present this problem.

Using .NET Framework 4.5.1 if it matters. Update: 4.5 did not make a difference.

Here's an image of the problem:

Issue

Jeff
  • 12,085
  • 12
  • 82
  • 152
  • Experiencing the same issue. Managed to get it to work for a bit by deleting the Webjobs json and re-adding, but after the weekend it's failing again :( – Matt Hilton Jul 13 '15 at 01:02
  • I'll try to help with this issue - a few questions. Which version of the WebJobs Publish NuGet are you using? Make sure you updated that NuGet using the "Manage NuGet Packages" gesture on your project. Also, which version of WTE are you running - with SDK 2.6? – brady gaster Jul 13 '15 at 17:04
  • At the time, the latest. Not at my devbox atm so can't tell. Recreating my website in azure did the trick though. – Jeff Jul 13 '15 at 17:06
  • Very weird. If you see this again please post an update. – brady gaster Jul 13 '15 at 18:14
  • I have the exact same problem - one web app hangs when publishing - same symptoms - dev studio is still responsive but just stops oin the middle of publishing at the exact same point every time - tried recreating the azure web app but to no avail ! – Garrett Hussey Sep 17 '15 at 19:02
  • This may not be related to your issue, but we had a similar issue after adding a webjob to our web application hanging mid-publish. The problem for us was caused by a couple of projects in the solution not being in a child folder below the solution file. This caused it to hang every time in the build phase of the publish. Moving the projects to a location below the solution file resolved the issue. – BBoy Oct 08 '15 at 01:43
  • @bradygaster I am experiencing this issue again, with a new project. Using 1.0.3. – Jeff Oct 30 '15 at 13:09
  • Sorry, the version is `1.0.7` – Jeff Oct 30 '15 at 13:29
  • Just to confirm Jeff - you're using 1.0.7, right? – brady gaster Nov 02 '15 at 18:07
  • One last question - are you trying to publish a console app "as a webjob" on its own, or are you trying to publish a Web App project inclusive of 1 or more WebJob projects at the same time? Thanks for helping troubleshoot. – brady gaster Nov 04 '15 at 17:28
  • @bradygaster no problem! I am trying to publish a Web App project including one or more webjobs. Publishing the WebJob by itself works fine. – Jeff Nov 04 '15 at 17:29
  • @bradygaster this is now an issue for the original project again. This is really bad... – Jeff Nov 04 '15 at 19:59
  • @bradygaster UPDATE: Cleaning packages folder and restoring made the issue go away from this project, will try for the other one when I am back at work. – Jeff Nov 04 '15 at 20:39
  • That's good to hear. Keep me posted! – brady gaster Nov 05 '15 at 19:25
  • @bradygaster the reinstall did *not* do the trick for the other case. – Jeff Nov 11 '15 at 13:50

1 Answers1

15

Setting the "maximum number of parallel project builds" to 1 (default is 4) solved the problem for me. It is in Tools > Options > Projects and Solutions > Build and Run

Nuri Tasdemir
  • 9,720
  • 3
  • 42
  • 67
  • This fixed it for me. I wish someone *cough* @bradygaster *cough* would explain why – JasonCoder Mar 29 '16 at 18:21
  • My guess is that there is a bug in Visual Studio :) And it screws up managing project dependencies while building projects in parallel and it becomes stuck in the build phase of publish. Therefore setting the max to 1 solves the problem in my case. – Nuri Tasdemir Mar 29 '16 at 19:36
  • @NuriTasdemir Thanks! you saved the day. we are experiencing this issue ever since we upgraded to VS 2017, changing the setting to 1 fixed it. – Kumar Garapati Jan 11 '18 at 15:08
  • 1
    You saved my life Nuri. I owe you a beer. – Sebastián Guerrero Jul 29 '19 at 16:19
  • Does this mean that all builds will be slower!? I would have thought parallel builds is a desirable feature, making this solution just a temporary hack. – Savage Mar 24 '20 at 14:18
  • Apparently this problem still exists in the latest version of VS2019 – PaulVrugt Feb 03 '21 at 08:37
  • 1
    I've opened an issue on the develop community for this: https://developercommunity2.visualstudio.com/t/deploying-web-app-with-webjob-to-app-service-hangs/1330382?from=email&viewtype=all – PaulVrugt Feb 15 '21 at 15:02