Web Deployment Project & TeamCity

走远了吗. 提交于 2019-12-04 04:56:56
Luca Arpaia

More suitable solution should be to set TargetFrameworkSDKDirectoryBin property in your .wdproj file. For example:

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

this setting, used in .dtproj file, override the default setting defined in Microsoft.WebDeployment.targets as you can see here

<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>

the second AspnetMergePath means that if exists somewhere else a $(TargetFrameworkSDKDirectoryBin) that point to an existing aspnet_merge.exe file, this will be used.

ok your aspnet_merge is being pointed to the wrong place - in my build script i have something that ends up as follows:

<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>

try it and see

Change the following node at line 1562 in the file "Microsoft.WebDeployment.targets" :

    <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>

I added a workaround comment on the appropriate Microsoft Connect page :
http://connect.microsoft.com/VisualStudio/feedback/details/706047/visual-studio-2010-web-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!