0
votes

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.

1
Web projects only transform on publish or package, not on build. There is a long standing feature request for me to get it working for web, but I have not yet gotten there.Sayed Ibrahim Hashimi
Off-topic: we also use AnthillPro - are you able to get the packages you are retrieving from NuGet to be reported in AHP as dependencies of your build life, or are these 'invisible' in the dependency graph?Hoobajoob
nuGet packages don't show up as dependencies. We could probably script something to figure this out but we have bigger fish to fry right now.Richard Schaefer

1 Answers

0
votes

I had a similar problem and it turned out that during a merge, in my csproj file, the PropertyGroup (labelled SlowCheetah) went down the Import element.

It should be like this

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

Then

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

Here is why the order of elements is important in a build file. Hope it helps