How to install/restore nuget packages(Telerik) for sln/csproj files using jenkins without visual studio

In case of dotnet project,

  1. package references for nuget and Telerik(nuget V3) are added in csproj/sln files in Bitbucket repository.

  2. Those packages should be automatically installed on server where jenkins is installed through jenkins freestyle job (location where jenkins dotnet build command refers restored packages) .
    Jenkins ->freestyle job → dotnet build is not restoring packages automatically.
    And gives following error :
    : error NU1301: Unable to load the service index for source https://nuget.telerik.com/v3/index.json.

  3. nuget.config file is added in bitbucket repository with package sources nuget.org , telerik v3.

  4. Error can be solved by open solution file in visual studio → tools → Nuget package manager ->manage package solution → select package for source → install for the version.

How Can I solve(install package with specified version in csproj) 4th point using jenkins without using visual studio.

Hello @Vedashri_Cserve and welcome to this community :wave:

Are you using your Jenkins controller as a node running jobs or do you have a distinct agent (even if it is on the same machine)?
Thanks.

Using Jenkins controller build in node.

That would be my first suggestion to look into. Sounds like you need to either user, or not use a proxy, or some other network related change. Is there someone incharge of your network you can talk to?

1 Like