简体   繁体   中英

Installing packages from the command line for Jenkins automation

I have to do automated testing on a VisualStudio c# Web service Project.
For this I have to download the project using Jenkins, compile it, run it, and then run an automated test on the local webpage, to ensure functionality.

My problem is that when trying to build the project, it won't restore all the NuGet packages needed.
Some of these aren't in packages. config or in project. the project, others are on the web. config but not anywhere else.

I tried nuget.exe and dotNET but these won't download the needed packages

I tried using dotNET to add packages to the project but there's an error:
"El proyecto no permite agregar referencias de paquete mediante el comando add package"
The project doesn't allow package references through the add package command.

I tried adding the references manually through a script that adds the XML nodes and through that I managed to make NuGet restore download the packages but these were not installed properly, I was left with *.nupkg files that I then had to unzip.

And now that I'm at my wits' end in regards to this issue I need help to solve this problem.
I would prefer if I can be as unintrusive on the developers on the project, but I'll do whatever is needed.

Well, after lots of trial and error i managed to get the project working by making sure the packages.config, Project.csproj and Project.sln files were exactly the same as a working version of the project. After that i use nuget restore to download the packages and unzip them with a .bat file. It isnt pretty but it's what worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM