在MSBuild中找不到MSDeploy任务

在MSBuild中找不到MSDeploy任务,msbuild,msdeploy,webdeploy,Msbuild,Msdeploy,Webdeploy,我试图在MSBuild中使用MSDeploy任务(而不是从命令行调用它)。我假设此任务是内置于MSBuild中的,但我似乎很难找到该任务。我得到的错误如下。我刚刚重新安装了WebDeploy工具,看看它是否有帮助 C:\CLIENTS\DAM\Components\Umbraco\SiteTemplate_v6_1_6\Build>msbuild MSBuildScript.csproj -t:Deploy_v2 Microsoft (R) Build Engine version 4.0

我试图在MSBuild中使用MSDeploy任务(而不是从命令行调用它)。我假设此任务是内置于MSBuild中的,但我似乎很难找到该任务。我得到的错误如下。我刚刚重新安装了WebDeploy工具,看看它是否有帮助

C:\CLIENTS\DAM\Components\Umbraco\SiteTemplate_v6_1_6\Build>msbuild MSBuildScript.csproj -t:Deploy_v2
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18052]

<!-- some other stuff -->

error MSB4036: The "MSDeploy" task was not found. Check
     the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and imple
    ments the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks
    files located in the "c:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
C:\CLIENTS\DAM\Components\Umbraco\sitemplate\u v6\u 1\u 6\Build>msbuild MSBuildScript.csproj-t:Deploy\u v2
Microsoft(R)生成引擎版本4.0.30319.17929
[Microsoft.NET Framework,版本4.0.30319.18052]
错误MSB4036:未找到“MSDeploy”任务。检查
以下内容:1.)项目文件中的任务名称与任务类的名称相同。2.)任务类是“公共”的,并且是简单的
单击Microsoft.Build.Framework.ITask接口。3.)任务在项目文件或*.tasks中正确声明
位于“c:\Windows\Microsoft.NET\Framework\v4.0.30319”目录中的文件。

v10.0可以变化(例如v11.0)

搜索“Microsoft.WebApplication.targets”文件并更改导入语句以匹配

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="AllTargetsWrapped">

        <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

    <!-- Bunch of Other Stuff -->



    <Target Name="AllTargetsWrapped">

        <CallTarget Targets="ShowVariables" />

    </Target>


    <Target Name="ShowVariables" >
        <Message Text="MSBuildExtensionsPath = $(MSBuildExtensionsPath)" />
    </Target>

谢谢,我也尝试过类似的方法,但只要复制您的导入声明就行了。