If I install .net core sdk does this also install nuget?
Cant seem to find anywhere that says yes. Looking to know as I am looking to do this on our build server
Looking at cli there is dotnet restore, dotnet nuget delete etc, so I am presuming yes.
If yes can I configure nuget in the same way as it is when I install nuget i.e. through this file location on windows:$env:APPDATA/nuget/NuGet.Config
Yes, the .NET Core Sdk ("CLI") contains a distribution of NuGet.
This integrated distribution is similar to the NuGet integration of VS 2017.
As you already inferred, it powers dotnet restore and the implicit restore performed during builds. There are also additional NuGet commands available via the dotnet nuget verb.
However, this is not a version of nuget.exe and most prominently does not support restoring packages.config based projects and dotnet nuget only supports a subset of features that nuget.exe offers.
Also, it uses the user-wide NuGet.Config from %APPDATA%\NuGet\NuGet.Config directory on windows and ~/.nuget/NuGet.Config on non-windows systems.
Related
We have a .net solution that contains .net standard 2.0 projects and .net framework projects.
On each build with TeamCity we have a step with NuGet Installer to restore the nuget packages for solution (nuget version 4.3.0). The step works fine, it restores the nuget packages but on Nuget Packages tab at Used Packages section we see only the nugets from .net framework projects.
Only the .net framework projects have packages.config file, the .net standard 2.0 ones doesn't have this files because nuget package manager uses PackageReference by default (as stated here https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) so the nugets used are included in .csproj files.
What can be done in order for nuget packages for .net standard 2.0 projects show up on on Nuget Packages tab at Used Packages section ?
Thank you,
Adriana
Seems is a known issue of TeamCity, and if we need it fixed we should vote for it here: https://youtrack.jetbrains.com/issue/TW-52327
If anyone else has a workaround till is fixed please post it :)
I've started using dotnetcore for a hobby project.
I'm having an issue trying to install NLog. The Visual Studio Code editor seems to recognise the beta version as the intelisense suggests it inside the project.json file. However nuget doesn't seem to restore it.
Is there a way to enable pre-release on Nuget packages in the new dotnet core platform?
Is the package on the Nuget repo? Check this link to see if its listed:
https://www.nuget.org/packages/NLog
If it's on there you can just add it to your project.json and then run a dotnet restore to install the nuget, no intellisense required.
I came across the answer to my question whilst watching a PluralSight video on Entity Framework Core By Dr Scott Allen.
One option is to use the visual studio package manager console and use the -pre flag. e.g:
install-package Microsoft.EntityFrameworkCore.tools -pre
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.
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.
I just inherited a large enterprise system that appears to use NuGet.
I have just read the basics on what NuGet is so pardon the simpleness of my questions.
Is there a way to tell NuGet to update and install all the packages needed to run the system? I am right now running and seeing what fails then guessing what NuGet packages are missing.
(No, there was no documentation in the enterprise system or many code comments, ugh)
From the package manager console try Update-Package –Project ProjectName
Visual Studio -> Tools -> Library Package Manager -> Package Manager Console
http://nuget.codeplex.com/wikipage?title=Updating%20All%20Packages
If the solution is configured to enable Nuget Package Restore you could also just delete the packages folder and rebuild all which would get everything that you needed. If you need to worry about javascript, configuration, etc... I would try the Update-Package route