0

I've implemented SlowCheetah in a web project. I'm running NuGet v2.7, but still using Enable Package Restore. I run a build workflow in AntHillPro that first runs NuGet Package Restore then MSBuild on the solution. The Package Restore steps indicates it is successfully reinstalling SLowCheetah, but the MSBuild step shows no execution of the transform process for config files other than web.config. I tried switching to the v2.7 NuGet Command Line Restore but that changed nothing. I'm back with Enable Package Restore but I have no idea where to go from here and how to debug this problem. I'd swear it was working correctly a couple of weeks ago. Not sure if I have a SlowCheetah problem or a NuGet problem. How do I debug this? Any help is greatly appreciated.

4

1 回答 1

0

我遇到了类似的问题,结果发现在合并期间,在我的 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" />

就是为什么元素的顺序在构建文件中很重要的原因。希望能帮助到你

于 2015-12-22T08:15:26.720 回答