Web部署项目& TeamCity的

时间:2011-07-07 13:29:56

标签: asp.net msbuild teamcity web-deployment-project

我正在尝试为解决方案构建Web部署项目2010项目。我在构建服务器上安装了Windows SDK和Web部署项目2010 RTW,并复制了MSBuild缺少的.target文件。

尝试构建项目时会吐出以下错误

  

C:\ Program Files \ MSBuild \ Microsoft \ WebDeployment \ v10.0 \ Microsoft.WebDeployment.targets(1589,9):error MSB6004:指定的任务可执行文件位置“C:\ Program Files \ MSBuild \ Microsoft \ WebDeployment \ v10.0 \ aspnet_merge.exe“无效。

不幸的是,在Google上搜索有关此错误的结果并未发现任何有价值的信息。任何有助于TeamCity成功构建Web部署项目的帮助都将受到赞赏。

3 个答案:

答案 0 :(得分:4)

好的,你的aspnet_merge被指向错误的地方 - 在我的构建脚本中,我的内容最终如下:

<ItemGroup>
    <ASPNETPath Include="F:\Program Files\Microsoft SDKs\Windows\v6.0A\bin" />
</ItemGroup>

<Target Name="ASPNET Merge">
    <AspNetMerge
      ExePath="@(ASPNETPath)"
      ApplicationPath=".\Release"
      SingleAssemblyName="CoreMicrosite"
      />
</Target>

试一试,看看

答案 1 :(得分:3)

更合适的解决方案应该是在.wdproj文件中设置TargetFrameworkSDKDirectoryBin属性。例如:

<TargetFrameworkSDKDirectoryBin>C:\Programmi\Microsoft SDKs\Windows\v7.1\Bin\</TargetFrameworkSDKDirectoryBin>

.dtproj文件中使用的此设置会覆盖Microsoft.WebDeployment.targets中定义的默认设置,如您所见

<Target
  Name="GetAspNetMergePath"
  DependsOnTargets="$(GetAspNetMergePathDependsOn)">
  <PropertyGroup>
      <AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
      <AspnetMergePath>$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v10.0</AspnetMergePath>
      <AspnetMergePath Condition="Exists('$(TargetFrameworkSDKDirectoryBin)$(AspnetMergeName)')">$(TargetFrameworkSDKDirectoryBin)</AspnetMergePath>
  </PropertyGroup>
</Target>

第二个AspnetMergePath表示如果存在指向现有aspnet_merge.exe文件的其他地方$(TargetFrameworkSDKDirectoryBin),则会使用此文件。

答案 2 :(得分:2)

更改文件“Microsoft.WebDeployment.targets”中第1562行的以下节点:

    <Target
        Name="GetAspNetMergePath"
        DependsOnTargets="$(GetAspNetMergePathDependsOn)">
        <PropertyGroup>
            <AspnetMergeName>aspnet_merge.exe</AspnetMergeName>
            <!-- OLD
            <AspnetMergePath>$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v10.0</AspnetMergePath>
            <AspnetMergePath Condition="Exists('$(TargetFrameworkSDKDirectoryBin)$(AspnetMergeName)')">$(TargetFrameworkSDKDirectoryBin)</AspnetMergePath>
            -->
            <AspnetMergePath>C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\</AspnetMergePath>
            <AspnetMergePath Condition=" '$(TargetFrameworkVersion)' == 'v4.0' ">C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\</AspnetMergePath>
        </PropertyGroup>
    </Target>

我在相应的Microsoft Connect页面上添加了一个解决方法评论:
http://connect.microsoft.com/VisualStudio/feedback/details/706047/visual-studio-2010-web-deployment