I'm running the following command on a build server:
Nuget.exe install MyPkgName -Source C:\temp\somefolder -OutputDirectory C:\temp\someotherfolder
I'm running it as part of unpacking build artifacts (nuget packages) in TeamCity as part of a packaging process on a build server. So the same packages have been unpacked before on this server, but the workspace is cleaned everytime, yet it fails with:
All packages listed in C:\temp\packages.config are already installed.
There is no packages.config in that location, and I can't understand where nuget is storing the information that the package is installed.
Was a regex issue in the powershell script where it didnt get the package name correctly, my bad.
Related
I have Nuget Server on TeamCity and when i try download package from server to dnx project list of the packages is empty, but when i try manualy add to project (by project.json) then it works.
How i should configure my TeamCity Nuget server or something other?
It appears that this is an issue with TeamCity's NuGet server as NuGet's public servers behave just fine. If I were to guess, there is some problem with passing in arguments for .NET Core assemblies / framework projects.
You want to have the TeamCity .NET Core plugin installed on TeamCity and use the "dotnet restore" command -- with the TeamCity URL for your NuGet package - and it should work as expected after that. For solutions mixed with csproj and xproj files, it has been my experience that you need a NuGet Installer and dotnet restore build step to get the job done. For NuGet, you want to have 3.5.0 (only available in beta at the time of this writing) or later to understand projects that contain a project.json -- and to not error out.
How can I install nuget packages for my PowerShell Projects in Visual Studio 2015? I have tried to do it with both the PowerShell Module Project and PowerShell Script Project. I have installed PowerShell Tools for Visual Studio 2015.
When I open these projects, the Default project in the Package Manager Console is empty. Here is a screenshot of what I mean.
When I try to install a nuget package, e.g. Pester, I get the following error.
I know this thread might be outdated and is rather old but my older article with some possible solutions might help here. I tested current state and still, no support inside VS 2015 for PowerShell project and NuGet packages together.
the current state is :
go with https://chocolatey.org/ and install it on your dev box (and CI) => you install pester globally with : choco install pester and update it if needed.
use old packages.config and update by hand version number and run nuget restore (nuget update will no longer work for this type of solution).
version whole pester into repo and call it directly. you can use nuget install pester for this (if you have nuget in path somewhere)
The link : http://rostacik.net/2015/12/16/how-to-use-nuget-packages-even-with-powershell-projects-with-visual-studio-2015/
Using team city as our CI and I've started getting this error message. We've obviously updated System.Net.Http recently which now needs a new version of NuGet. How do I get team city to find the new NuGet version. I've tried installing VS2015 and updating NuGet package manager through there. I've tried pointing directly to the command line nuget.exe (Don't know if that's been updated to v3?)
[restore] The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60717.93'.
[restore] Process exited with code 1
Do I just have to just wait till MS pushing the new nuget package to nuget?
Thanks
On your teamcity client you can configure the nuget versions available to your build agents.
Go to Administration -> Integrations -> NuGet
From this screen you can click Fetch NuGet and retrieve the latest version. Then you should be able to specify that version on your build step.
Download NuGet 3.1 from this url:
http://dist.nuget.org/win-x86-commandline/v3.1.0-beta/nuget.exe
Then put that on your build server, put the directory in your path, and run your NuGet build steps as "Command Line" commands in TeamCity, using NuGet.exe.
I think you need TeamCity 9.1, as that version contains the VS2015 build tools: https://confluence.jetbrains.com/display/TCD9/What%27s+New+in+TeamCity+9.1
NuGet 3.0 was released with VS2015: http://docs.nuget.org/release-notes/nuget-3.0.0
In earlier versions of Visual Studio you could add a System reference to System.Net.Http, but Microsoft has now moved that into a NuGet package.
For the life of me I can't find an option to install all nuget packages to a central folder.
The only option seems to be Install and that always installs into the project folder.
With multiple projects using the same packages this is very inefficient.
I'd like to install all packages to the same central folder.
Can this be done?
Answer is here: Is it possible to change the location of packages for NuGet?
I successfully tried it with VS2012 and the latest nuget manager.
I recently installed Visual Studio on a new computer and as a result I now have Nuget 1.5.2. This version doesn't seem to work with my old solution. When I add a new project and try adding references via Nuget, it says they are already installed and does nothing, even though that reference doesn't exist in the new project.
Does anyone know why this might be happening or alternatively where I can download the old Nuget (1.4.2)?
Thanks!
The NuGet Command Line is available as a NuGet package.
Just like with any other NuGet package, you can get a specific version by using the -Version switch in the Package Manager Console.
To get v1.4.2 of the NuGet command line tool, you should execute the following PowerShell script from the Package Manager Console:
Install-Package Nuget.CommandLine -Version 1.4.20615.182