【问题标题】:SlowCheetah not transforming during MSBuild在 MSBuild 期间,SlowCheetah 没有转换
【发布时间】:2013-11-16 07:49:00
【问题描述】:

我在一个网络项目中实现了 SlowCheetah。我正在运行 NuGet v2.7,但仍在使用启用包还原。我在 AntHillPro 中运行构建工作流,首先运行 NuGet Package Restore,然后在解决方案上运行 MSBuild。包还原步骤表明它正在成功重新安装 SLowCheetah,但 MSBuild 步骤显示没有执行除 web.config 之外的配置文件的转换过程。我尝试切换到 v2.7 NuGet 命令行还原,但没有任何改变。我回来了启用包还原,但我不知道从这里去哪里以及如何调试这个问题。我发誓它在几周前工作正常。不确定我是否遇到了 SlowCheetah 问题或 NuGet 问题。我该如何调试?非常感谢任何帮助。

【问题讨论】:

  • Web 项目仅在发布或打包时转换,而不是在构建时转换。我有一个长期存在的功能要求让它在网络上工作,但我还没有做到。
  • 题外话:我们还使用 AnthillPro - 您是否能够让您从 NuGet 检索的包在 AHP 中报告为您的构建生命周期的依赖项,或者这些在依赖项中“不可见”图表?
  • nuGet 包不显示为依赖项。我们可能可以编写一些脚本来解决这个问题,但我们现在有更大的鱼要炒。

标签: visual-studio-2010 xslt visual-studio-2012 msbuild slowcheetah


【解决方案1】:

我遇到了类似的问题,结果发现在合并期间,在我的 csproj 文件中,PropertyGroup(标记为 SlowCheetah)在 Import 元素中下降。

应该是这样的

<PropertyGroup Label="SlowCheetah">
  <SlowCheetahToolsPath>$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\SlowCheetah.2.5.10.3\tools\))</SlowCheetahToolsPath>
  <SlowCheetah_EnableImportFromNuGet Condition=" '$(SC_EnableImportFromNuGet)'=='' ">true</SlowCheetah_EnableImportFromNuGet>
  <SlowCheetah_NuGetImportPath Condition=" '$(SlowCheetah_NuGetImportPath)'=='' ">$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\Properties\SlowCheetah\SlowCheetah.Transforms.targets ))</SlowCheetah_NuGetImportPath>
  <SlowCheetahTargets Condition=" '$(SlowCheetah_EnableImportFromNuGet)'=='true' and Exists('$(SlowCheetah_NuGetImportPath)') ">$(SlowCheetah_NuGetImportPath)</SlowCheetahTargets>
</PropertyGroup>

然后

<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />

Here 是构建文件中元素顺序很重要的原因。希望对你有帮助

【讨论】:

  • 我认为这已经为我们澄清了。自从我们从 VS2010 迁移到 VS2012+ 后,我还没有看到任何实例。也许项目文件管理变得更好了?由于项目已升级到 VS2012 并且您记录的条件在项目文件中不存在,因此我目前无法重现该问题。假设您是对的,我会将其标记为答案,并在再次发生时记住它。 :-)
猜你喜欢
  • 2013-09-03
  • 2012-11-10
  • 2014-10-12
  • 2017-07-27
  • 2015-02-07
  • 2015-12-28
  • 1970-01-01
  • 2015-06-18
  • 1970-01-01
相关资源
最近更新 更多