NuGet packages from TeamCity are not visible in DNX project - nuget

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.

Related

Nugets packages from .net Standard 2.0 projects not showing in NuGet packages tab in TeamCity

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 :)

.net core installation and nuget

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.

dotnetcore Nuget enable Pre-Release

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

'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above

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.

Getting test runner to work with Gallio from Nuget

I think I'm missing something here. I installed Tesdriven and then Gallio (third link from top - Gallio 3.5 x64 installer)
Then I installed the mbunit dlls from Nuget because I didn't want to include a dll from my hard drive as it makes it difficult for the project to be ported to other machines..
However, when I try to run a sample test, testrunner insists that I reference the dlls from my hard disk.. the actual error message is this:
It looks like you're trying to execute a Gallio/MbUnit unit test.
For Gallio v3.0.6 build 787 / Gallio v3.1 build 313 or above (recommended):
Please ensure that the directory containing your 'MbUnit.dll' reference also contains Gallio's
test runner files ('MbUnit.dll.tdnet', 'TDNet\Gallio.TDNetRunner.dll', 'Gallio.dll' etc.)
For earlier versions:
You need to install Gallio (after TestDriven.Net) using its MSI installer.
You can find Gallio downloads and support here:
http://www.gallio.org/
So, is there a way to get testrunner to run the tests with just nuget packages, please?
Currently nuget gallery has only 3.3.1 version of mbunit package, and you installed Gallio v3.4. It's very annoying limitation of gallio and mbunit. In order to use nuget package you have to downgrade Gallio on your machine to v3.3.1. Better solution it's mail to gallio/mbunit team and ask to upload nuget package with latest release or make it by yourself.