我在网络项目中实现了SlowCheetah。我正在运行NuGet v2.7,但仍然使用启用包恢复。我在AntHillPro中运行构建工作流,首先在解决方案上运行NuGet Package Restore,然后运行MSBuild。 “包还原”步骤表明它已成功重新安装SLowCheetah,但MSBuild步骤未显示web.config以外的配置文件的转换过程。我尝试切换到v2.7 NuGet命令行恢复,但没有改变任何东西。我回来了启用包恢复,但我不知道从这里去哪里以及如何调试此问题。我发誓它几周前工作正常。不确定我是否有SlowCheetah问题或NuGet问题。我该如何调试?非常感谢任何帮助。
答案 0 :(得分: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" />
Here是元素的顺序在构建文件中很重要的原因。希望它有所帮助