Domanda

I am trying to use the MSDeploy task within MSBuild (instead of calling it form the command line). I assumed this task was built in to MSBuild but I seem to be having trouble finding the task. The error Im getting is below. I have just re-installed the Web Deploy Tool to see if it might help.

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.
È stato utile?

Soluzione

v10.0 can vary (v11.0 for example)

Do a search for your "Microsoft.WebApplication.targets" file and alter the import statement to match.

<?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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top