I use Visual Studio 2015 and azure sdk 2.7.1. I created azure web job. When I run deploy I get error:
The target "MSDeployPublish" does not exist in the project.
I created web job in Visual Studio 2013 - deploy is work. I compare the two projects(2015 and 2013) - in 2013 there is this code:
<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.3\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.3\tools\webjobs .targets')" />
I put this code in my project in 2015, but deploy is not working. I saw
this question, but it does not work for me.
Using VS2015, when installing the Microsoft.Web.WebJobs.Publish
NuGet package I noticed in the package console that the install.ps1 powershell script threw an error due to lack of execute permissions. On inspection it appears this script was meant to add in an import reference within the .csproj of the project I was installing to. Adding the following line to my .csproj file did the trick and fixed the above error for me;
<Import Project="..\packages\Microsoft.Web.WebJobs.Publish.1.0.6\tools\webjobs.targets" Condition="Exists('..\packages\Microsoft.Web.WebJobs.Publish.1.0.6\tools\webjobs.targets')" />
Note: your package version might be different, in which case replace 1.0.6
with whatever version matches your installed package.
Note: Your solution setup may be different, in which case make sure your path to the ..\packages
folder is correct.
Note: this issue occurs when you don't run VS with administrator rights.
I had to remove the Nuget, restart with administrator rights, and add it again to resolve the issue.
I was able to get this issue resolved simply by adding a reference to the above mentioned Microsoft.Web.WebJobs.Publish
NuGet package. No additional modification of the .csproj file were necessary in my case. I'll assume that's because of improvements in the VS 2015 tooling since the question was first posted ;)
This works for me
Step 1: Run Visual studio as an administrator
Step 2: Make sure you have the import line (mentioned above in previous comments) in .csProj file
Step 3: Delete Webjob.Publish.Settings.JSON file (as it was showing an error) and Publishing profiles
Step 4: Deploy as Azure web job
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With