【问题标题】:Tfs and nuget: project files are forever in check out after build with restore nuget packagesTfs 和 nuget:使用还原 nuget 包构建后,项目文件将永远签出
【发布时间】:2015-09-03 18:35:57
【问题描述】:

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>

如何解决此问题?

【问题讨论】:

    标签: visual-studio-2012 tfs nuget


    【解决方案1】:

    从 NuGet v2.7 开始,MSBuild-Integrated Package Restore 已被弃用,并被 Automatic Package Restore 取代。

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

    要了解有关自动包恢复的更多信息,请参阅 NuGet Package Restore

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

    【讨论】:

      猜你喜欢
      • 2017-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2017-08-16
      • 2014-06-17
      • 1970-01-01
      • 2015-01-11
      相关资源
      最近更新 更多