I have an ASP.NET project with two WebJobs, one of WebJobs publishes fine, but the second fails to publish, and I get the following error message:
The target "AddScheduledJob" does not exist in the project.
Both are WebJobs that are configured to run on demand.
I'm struggling to find some explanation for this error and can't see what sets my two WebJobs apart. Has anyone come across this?
Edited
In the end, I found the problem thanks to the fact that David Ebbo pointed me in the right direction. I found that I had two import lines in the .csproj file of one of my WebJobs projects:
<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.2\tools\webjobs.targets')" />
After removing the first one, everything worked fine. I donβt know how this happened, but you can only assume that something went wrong when I updated the NuGet package.
source share