I'm trying to build a solution on a Jenkins with the MSBuild extension. I've migrated the solution from VS 2013 to VS 2015. To be able to restore the NuGet Packages in Visual Studio 2015 I had to remove the .nuget folder as recommended here: http://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore.
Now the issue is that MSBuild needs the .nuget folder to be able to restore the nuget packages.
Build FAILED.
"E:\_JENKINS\workspace\Project1 - Deploy DEVELOP to BuildServer\Solution1\Build\Build.proj" (DeployTarget target) (1) ->
E:\_JENKINS\workspace\Project1 - Deploy DEVELOP to BuildServer\Solution1\Build\Build.proj(50,5):
error MSB4019: The imported project "E:\_JENKINS\workspace\Project1 - Deploy DEVELOP to BuildServer\Solution1\.nuget\NuGet.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Have I mixed up things? Do I do something completely wrong?
Because only one works: either MSBuild or Studio Package Restore.
So either I'm adding the packages folder to git or replace the automatic restore in the solution by a command line restore or MSBuild restore. But anyway both solutions seem to be wrong.
nuget restore solution.sln
to restore the packages before compiling. NuGet documentation has more about such migration. - Lex Li