Error MSB4057: The target MSDeployPublish does not exist in the project

kikme
kikme
30 Points
10 Posts

I am trying to publish a Webjob through VS 2019 Community. I have done it before in the other webjob project in the same solution, but this time it seems to not be working.
I got the publish profile settings from Azure app service and the validation on the connection works fine.
When I do the publish through VS I'm getting this error:

Error MSB4057: The target "MSDeployPublish" does not exist in the project

I tried several things like,
intalling MSBuild.Microsoft.VisualStudio.Web.targets Nuget Package and
also, re-intalling Microsoft.Web.WebJobs.Publish several times, but not success.

Views: 149
Total Answered: 2
Total Marked As Answer: 1
Posted On: 25-Oct-2019 08:52

Share:   fb twitter linkedin
Answers
Smith
Smith
Participant
418 Points
119 Posts
         

This was worked for me

  1. Run Visual studio as an administrator
  2. Make sure you have the following ling in .csProj file

    <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.
  3. Delete Webjob.Publish.Settings.JSON file (as it was showing an error) and Publishing profiles
  4. Deploy as Azure web job
Posted On: 25-Oct-2019 09:22
kikme
kikme
30 Points
10 Posts
         

Thank Smith. 

Issue was resolved by deleting Webjob.Publish.Settings.JSON file (as it was showing an error) and then import again Publishing profiles.

Posted On: 12-Nov-2019 23:14
 Log In to Chat