The target “MSDeployPublish” does not exist in the project

前端 未结 12 1614
夕颜
夕颜 2020-12-15 19:48

I know there have been other references to this issue. But I didn\'t upgrade from one version of VS to another. I am currently using VS 2013. The project builds fine, and ha

相关标签:
12条回答
  • 2020-12-15 20:05

    For those who are deploying a WebJob, this error might also be due to a missing webjob-publish-settings.json file (it should be located in the Properties folder of the WebJob project). Its structure should be e.g:

    {
      "$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
      "webJobName": "MyWebJob",
      "startTime": "2017-01-27T03:00:00+00:00",
      "endTime": null,
      "jobRecurrenceFrequency": "Hour",
      "interval": 1,
      "runMode": "Scheduled",
      "is_singleton": true
    }
    

    (this is for an hourly scheduled job).

    0 讨论(0)
  • 2020-12-15 20:08

    FYI, same issue on VS2019, same solution:

    • Install the nuget Microsoft.Web.WebJobs.Publish Install the nuget
    • MSBuild.Microsoft.VisualStudio.Web.targets
    0 讨论(0)
  • 2020-12-15 20:08

    Having just re-installed VS 2017 (15.5.6) I ran into this with one of three WCF projects. I picked through the csprojs for all three and could find no difference between them, cutting and pasting the various imports, paths etc from the working ones didn't make any difference.

    Adding the nuget package MSBuild.Microsoft.VisualStudio.Web.targets (v14.0.0.3 was the latest, i.e. VS2015) has fixed the problem...for the moment. I can't believe this has gone away for good though.

    0 讨论(0)
  • 2020-12-15 20:09

    I hit this same problem with a project loaded in Visual Studio 2017. It was previously working on a different machine, but not when I migrated to a new one.

    After trying all of the suggestions in the answers here (the question is somewhat duplicated several times on StackOverflow), I finally ran across someone elsewhere who mentioned installing the Azure SDK for VS2015.

    This isn't supposed to be needed for VS2017, but it solved the problem for me. I'd previously used 2015 on my old machine but had switched to 2017. Apparently, the SDK bits still mattered.

    0 讨论(0)
  • 2020-12-15 20:12

    To add to the answer by @Uri Golani, a switch to the new PackageReference way instead of with the traditional nuget that uses the packages folder, meant it looked like I could delete the packages folder. Whelp, apparently, those references in the csproj to the packages folder (which folder I had deleted) were the problem. I'm not sure how to get the right reference to something else (whatever cache the PackageReferences refer to), so for now, just re-adding a packages folder, with the Microsoft.Bcl.Build.1.0.21 and the Microsoft.Web.WebJobs.Publish.1.1.0 nuget folders seemed to fix this.

    0 讨论(0)
  • 2020-12-15 20:21

    I got this error in a project with a project.json for the nuget packages.

    When I removed the project.json and used the packages.config everything worked fine.

    Mind that I did set the ExecutionPolicy for Windows PowerShell before I tried this, (see solution of @Jon Crowell), this might be necesary too.

    If anybody finds a way to solve this with a project.json please let me know!

    0 讨论(0)
提交回复
热议问题