ASP.NET Webdeploy失败;项目中不存在AddScheduledJob [英] ASP.NET Webdeploy failing; AddScheduledJob does not exist in project

查看:57
本文介绍了ASP.NET Webdeploy失败;项目中不存在AddScheduledJob的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个WebJob的ASP.NET项目,其中一个WebJob发布良好,但第二个WebJob发布失败,并且出现以下错误消息:

I have an ASP.NET project with two WebJobs, one of the WebJobs publishes fine but the second fails to publish and I get the following error message:

项目中不存在目标"AddScheduledJob".

The target "AddScheduledJob" does not exist in the project.

两个WebJob均在按需运行"模式下设置.

Both WebJobs where set up in the "Run on Demand" mode.

我正在努力寻找对此错误的任何解释,但看不到我的两个WebJob之间有什么不同.有人碰到这个吗?

I am struggling to find any explanation for this error and cannot see what is different between my two WebJobs. Anyone come across this?

已编辑

由于大卫·埃博(David Ebbo)向我指出了正确的方向,所以我最终找到了问题.我发现我在一个WebJobs项目的.csproj文件中最后添加了两个导入行:

I eventually found the problem thanks to David Ebbo pointing me in the right direction. I found that I had ended up with 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')" />

删除其中的第一个后,一切正常.我不知道这是怎么发生的,但只能假设在更新NuGet软件包时出了点问题.

After deleting the first of these everything worked fine. I don't know how this happened but can only assume that something went wrong when I updated the NuGet package.

推荐答案

当我在ASP.NET站点下有现有的WebJob SDK项目时,我遇到了类似的问题,并添加了一个新项目.新版本使用的是Microsoft.Web.WebJobs.Publish程序包的较新版本.

I had a similar problem when I had existing WebJob SDK projects under an ASP.NET site, and I added a new one. The new one was using a newer version of the Microsoft.Web.WebJobs.Publish package.

我使用将现有项目添加为Azure WebJob"流进行添加,然后我发现在ASP.NET项目中现在有两个导入:

I used the "Add Existing Project as Azure WebJob" flow to add it, and then I noticed in the ASP.NET project that there were now two Imports:

  <Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.10\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.10\tools\webjobs.targets')" />
  <Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.1.0\tools\webjobs.targets')" />

我只是使用较旧的版本删除了导入,并且已经解决了这个问题.

I simply removed the Import with the older version and that took care of it.

这篇关于ASP.NET Webdeploy失败;项目中不存在AddScheduledJob的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆