Web部署项目&团队城市

发布于 2024-11-18 16:30:49 字数 471 浏览 4 评论 0原文

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

当尝试构建项目时,它会抛出以下错误

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

不幸的是,在 Google 上搜索有关此错误的结果并没有透露任何有价值的信息。任何帮助 TeamCity 成功构建 Web 部署项目的帮助都将不胜感激。

I am trying to build a web deployment project 2010 project for a solution. I have installed the Windows SDK and Web Deployment Project 2010 RTW on the build server, as well as copied over the missing .target files for MSBuild.

When attempting to build the project it spits out the following error

C:\Program Files\MSBuild\Microsoft\WebDeployment\v10.0\Microsoft.WebDeployment.targets(1589, 9): error MSB6004: The specified task executable location "C:\Program Files\MSBuild\Microsoft\WebDeployment\v10.0\aspnet_merge.exe" is invalid.

Unfortunately, searching around Google for results about this error don't reveal anything of much value. Any help to get TeamCity successfully building the web deployment project would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

趁微风不噪 2024-11-25 16:30:49

好的,您的 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>

尝试一下并查看

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

涙—继续流 2024-11-25 16:30:49

更合适的解决方案应该是在 .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 意味着如果其他地方存在 $( TargetFrameworkSDKDirectoryBin) 指向现有的 aspnet_merge.exe 文件,将使用该文件。

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.

他夏了夏天 2024-11-25 16:30:49

更改文件“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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文