NuGet auto-package restore just will not work for me on my build server

后端 未结 1 755
不思量自难忘°
不思量自难忘° 2021-01-26 18:26

I\'m at wits end here. I\'ve tried everything I can find to get NuGet to restore my packages on the TFS build server and nothing seems to work. (The latest changes I checked in

相关标签:
1条回答
  • 2021-01-26 19:13

    Since you have tried so many solutions based on google. Which may make your environment complex and confusing.

    First there are two ways to do the nuget restore MSBuild-integrated restore and Automatic restore in Visual Studio. There are totally different things.

    With NuGet 2.7 and later, Visual Studio automatically restores missing packages by default at the beginning of a build.

    Since you are using NuGet 3.4, suggest you to use Automatic restore.

    You could only select one way to do the restore operation. Based your error message NuGet.targets not found, maybe you haven't finished Migrating to automatic restore step. Please do it again or double check this.

    You could also test the migration, do the following:

    • Remove the packages folder from the solution.
    • Open the solution in Visual Studio and start a build.
    • Automatic restore should download and install each dependency package, without adding them to source control.

    Do not add $(SolutionDir).nuget\nuget.exe restore -SolutionDirectory ..\ to the pre-build event on my first project in the build order . This is the old way to do the restore. Just like the way describe here.

    Nuget Restore.exe was added to the 2013 (v12) templates. Since you are using the TfvcTemplate.12.xaml , you don't have to add it again.

    Highly doubt you were mixing up the two ways cause your present dilemma. Suggest you follow the automatic restore process, use a clean environment, complete migration to automatic restore step , test the migration locally, make sure NuGet.exe and NuGet.targets files from .nuget folder in source control are removed, checking pending changes, check your TfvcTemplate.12.xaml Process Templates with Nuget Restore functionality. Create a new build definition with old settings and use the template. Finally trigger the build...

    0 讨论(0)
提交回复
热议问题