2017-10-17 50 views
-1

我剛剛從TFS下載了當前的修訂版本。但是,即使在恢復nuget包之後,它仍然沒有建立。關於丟失Nugets的東西。下載後沒有建立TFS

任何援助將不勝感激。這是因爲我們使用不同的Visual Studio版本嗎?

我打開csproj文件來構建我的sln文件。

+0

** **具體你得到什麼錯誤?提供儘可能多的信息。 –

回答

0

不妨按照下面的步驟來解決這個問題:

  1. 關閉Visual Studio的
  2. 手動刪除本地「包」的文件夾
  3. 重新打開解決方案,並重建。 (的NuGet應該恢復 包

來源鏈接:Missing Nuget Packages on TFS Build Server

或者在NuGet包管理控制檯運行update-package -reinstall命令來重新安裝所有引用的包。


如果還是不行,就試試這個:

右擊.csproj並在記事本或任何編輯器打開它,然後刪除以下

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

然後建立自己的解決方案,它應該管用。

而且這個線程,供大家參考:NuGet not restoring packages on build

+0

原來,其他團隊成員改變了路徑到nugets。所以,即使正確地恢復它們,我也必須編輯csproj文件中的路徑才能構建它。 – Pug

+0

之後,我還必須在工具>程序包管理器控制檯中運行update-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r,以清理Roslyn bin問題。 – Pug