0

我在试图用来部署到远程服务器的 MSBuild 脚本中有一个 MSDEPLOY 任务。

<Target Name="Deploy_v2">
    <ItemGroup>
        <DeploySource Include="package">
            <Path>$(PackagePath)</Path>
        </DeploySource>
        <DeployDestination Include="auto">
            <ComputerName>https://C3PO:8172/msdeploy.axd</ComputerName>
            <UserName>C3PO\developer</UserName>
            <Password>Password123</Password>
            <AuthType>Basic</AuthType>
        </DeployDestination>
    </ItemGroup>
    <Message Text="About to deploy!!" />
    <MSDeploy
        Verb="sync"
        Source="@(DeploySource)"
        Destination="@(DeployDestination)" 
        AllowUntrusted="true"
    />
    </Target>

当我尝试运行它时,我收到一条非常奇怪的消息,如下所示:

MSDEPLOY : error : Unable to cast object of type 'Microsoft.Web.Deployment.DeploymentProviderOptions' to type 'Microsoft.Web.Deployment.Deployme
ntProviderOptions'.
4

1 回答 1

1

在您的硬盘驱动器中搜索“MSDeploy.exe”......并查看您拥有多少个不同的版本。

然后尝试设置“ToolPath”

<MSDeploy
    ToolPath="C:\OneOfTheFoldersWithMsDeployExeInIt" 
    Verb="sync"
    Source="@(DeploySource)"
    Destination="@(DeployDestination)" 
    AllowUntrusted="true"
/>
于 2013-10-25T15:26:53.703 回答