Tfs和nuget:项目文件在使用恢复nuget包构建后永远处于检出状态

时间:2015-06-18 08:17:39

标签: visual-studio-2012 tfs nuget

MS VS 2012
我在tfs中有解决方案,启用了nuget包恢复。每当我构建解决方案时,所有项目文件都会被这些更改所取消:

<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

自NuGet v2.7起, MSBuild-Integrated Package Restore 已被弃用,并替换为自动包恢复

请参阅有关如何将解决方案迁移到新功能的文档:Migrating MSBuild-Integrated solutions to use Automatic Package Restore

要详细了解自动包恢复,请参阅 NuGet Package Restore

这两篇文章讨论了这对TFS集成的影响。