Website not updated when deployed with a WebJob

安稳与你 提交于 2019-12-10 11:21:52

问题


I have a solution that has an ASP.NET MVC Web Application with source control in Visual Studio TFS online. The site is hosted in Azure, which deploys the site every time it is built in TFS online. Everything is working good.

I then added a Web Job project to the solution using Add > New Azure WebJob project and I set it up with some help from this post on the azure blog. Since then, I noticed that any changes made to the web application does not reflect on the deployed site anymore. I don't see any errors in the build log in TFS online.

To work around the issue, I have to 1) remove the web job project from the solution and 2) comment out everything in the webjobs-list.json file in the web application's Project Properties before deployment. This essentially puts the solution back in the state before the web job was added.

I was wondering what I could do to prevent my problem from occurring. I think I maybe missing some configuration step, but I don't know where to look.


回答1:


Azure's automatic source integration will only deploy the first project (alphabetically) in the solution. So if your new web job is named ahead of your old MVC application (alphabetically) it will try to deploy the web job instead of the MVC application.

There are two solutions to this:

1) Name your MVC project so it is first project in the solution alphabetically

2) Put your web job in a separate solution



来源:https://stackoverflow.com/questions/31025868/website-not-updated-when-deployed-with-a-webjob

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!