aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

kpm fails to download nuget packages

Open makzr opened this issue 12 years ago • 15 comments

Hi,

I'm on OS X Yosemite, Mono 3.6 and KRE 1.0.0-alpha4-10249 and kpm fails to download the nuget packages of the sample projects.

I searched for the missing packages on nuget.org and I could not find them. Looks like these packages are no longer available?

This is my console output:

~/Workspaces/HelloWeb> kpm restore Restoring packages for /Users/markus/Workspaces/HelloWeb/project.json Attempting to resolve dependency HelloWeb >= 1.0.0-SNAPSHOT Attempting to resolve dependency Kestrel >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Diagnostics >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Hosting >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Server.WebListener >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.StaticFiles >= 1.0.0 Attempting to resolve dependency mscorlib >= Attempting to resolve dependency System >= Attempting to resolve dependency System.Core >= Attempting to resolve dependency Microsoft.CSharp >= Attempting to resolve dependency HelloWeb >= 1.0.0-SNAPSHOT Attempting to resolve dependency Kestrel >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Diagnostics >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Hosting >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Server.WebListener >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.StaticFiles >= 1.0.0 Resolving complete, 3314ms elapsed Unable to locate Microsoft.AspNet.Diagnostics >= 1.0.0 Unable to locate Microsoft.AspNet.Server.WebListener >= 1.0.0 Unable to locate Microsoft.AspNet.StaticFiles >= 1.0.0 Unable to locate Kestrel >= 1.0.0 Unable to locate Microsoft.AspNet.Hosting >= 1.0.0 Restore complete, 3318ms elapsed

makzr avatar Aug 11 '14 06:08 makzr

Copy the NuGet.config from this repository into your project.

davidfowl avatar Aug 11 '14 09:08 davidfowl

Hey David,

same result:

~/Workspaces/HelloMvc> ls Controllers Models NuGet.config Startup.cs Views project.json ~/Workspaces/HelloMvc> kpm -v restore Restoring packages for /Users/markus/Workspaces/HelloMvc/project.json Attempting to resolve dependency HelloMvc >= 1.0.0-SNAPSHOT Attempting to resolve dependency Kestrel >= 1.0.0 CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel' Attempting to resolve dependency Microsoft.AspNet.Diagnostics >= 1.0.0 CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics' Attempting to resolve dependency Microsoft.AspNet.Hosting >= 1.0.0 CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Hosting' Attempting to resolve dependency Microsoft.AspNet.Mvc >= 6.0.0 CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Mvc' Attempting to resolve dependency Microsoft.AspNet.Server.WebListener >= 1.0.0 CACHE https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener' Attempting to resolve dependency mscorlib >= Attempting to resolve dependency System >= Attempting to resolve dependency System.Core >= Attempting to resolve dependency Microsoft.CSharp >= Attempting to resolve dependency HelloMvc >= 1.0.0-SNAPSHOT Attempting to resolve dependency Kestrel >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Diagnostics >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Hosting >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Mvc >= 6.0.0 Attempting to resolve dependency Microsoft.AspNet.Server.WebListener >= 1.0.0 Resolving complete, 114ms elapsed Unable to locate Kestrel >= 1.0.0 Unable to locate Microsoft.AspNet.Diagnostics >= 1.0.0 Unable to locate Microsoft.AspNet.Hosting >= 1.0.0 Unable to locate Microsoft.AspNet.Mvc >= 6.0.0 Unable to locate Microsoft.AspNet.Server.WebListener >= 1.0.0 Restore complete, 117ms elapsed

makzr avatar Aug 11 '14 09:08 makzr

I am getting the same on debian testing with mono 3.6.0

Restoring packages for /home/matthijs/MvcApplication1/project.json Attempting to resolve dependency MvcApplication1 >= 0.1-alpha-SNAPSHOT Attempting to resolve dependency Microsoft.AspNet.Diagnostics >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Hosting >= 1.0.0 Attempting to resolve dependency Microsoft.AspNet.Mvc >= 6.0.0 Attempting to resolve dependency Microsoft.AspNet.Server.WebListener >= 1.0.0 Attempting to resolve dependency Kestrel >= 1.0.0 Attempting to resolve dependency mscorlib >= Attempting to resolve dependency System >= Attempting to resolve dependency System.Core >= Attempting to resolve dependency Microsoft.CSharp >= Resolving complete, 10ms elapsed Unable to locate Microsoft.AspNet.Diagnostics >= 1.0.0 Unable to locate Microsoft.AspNet.Hosting >= 1.0.0 Unable to locate Microsoft.AspNet.Mvc >= 6.0.0 Unable to locate Microsoft.AspNet.Server.WebListener >= 1.0.0 Unable to locate Kestrel >= 1.0.0 Restore complete, 11ms elapsed Total time 259ms

matthijs@node1:~$ mono -V Mono JIT compiler version 3.6.0 (tarball Thu Aug 14 12:24:28 UTC 2014) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com TLS: __thread SIGSEGV: altstack Notifications: epoll Architecture: amd64 Disabled: none Misc: softdebug LLVM: supported, not enabled. GC: sgen

matthijsbreemans avatar Aug 20 '14 21:08 matthijsbreemans

Just to be certain, does your application have a NuGet.config that points to the right feeds? Here's what it needs to look like: https://github.com/aspnet/Home/blob/master/NuGet.Config

pranavkm avatar Aug 20 '14 21:08 pranavkm

Yes, I get the same error even when I place that NuGet.config in my root

matthijsbreemans avatar Aug 20 '14 21:08 matthijsbreemans

did you make sure you added the myget vnext repository and all the certs http://stackoverflow.com/questions/15181888/nuget-on-linux-error-getting-response-stream

Dave-Daniel avatar Aug 21 '14 15:08 Dave-Daniel

I had exact same problem trying to make it work on OpenSuse. I've been able to pass it with: kpm restore -s https://www.myget.org/F/aspnetmaster/

It looked like kpm ignored 'AspNetVNext' and always used 'NuGet.org' only

Biegal avatar Aug 21 '14 16:08 Biegal

Seems to be ignoring the NuGet repository at all running Debian.

I got it to work using kpm restore -s https://www.myget.org/F/aspnetmaster/ -f https://nuget.org/api/v2/

matthijsbreemans avatar Aug 21 '14 21:08 matthijsbreemans

kpm seems to ignore the NuGet.config when it is in your userdir root. When placing it in one directory deep it seems to load everything normal

matthijsbreemans avatar Aug 25 '14 18:08 matthijsbreemans

I fixed this problem (on windows) by moving the NuGet.Config up one directory. I remember it didn't work if the config file was in the same directory as the project.json file. Also, I seem to recall casing on the NuGet.Config file being important from when I was setting up build on Travis CI.

Alxandr avatar Sep 03 '14 07:09 Alxandr

@Biegal thanks, that "workarround" worked for me as well!

kjellski avatar Oct 10 '14 11:10 kjellski

@Biegal this works for me, thanks!

pinkli avatar Nov 25 '14 08:11 pinkli

I ran into this same issue while trying to get the vNext/Home samples up and running on Linux. I think it might be helpful to add a note to the Home repository's readme to help others in the future who are attempting to get the vNext samples running on a fresh install of linux/mono.

digitalthumbs avatar Nov 26 '14 23:11 digitalthumbs

worst documenttion ever.. the missing link is, as has beed discussed, the NuGet.Config file. MAKE SURE THE CASING MATCHES EXACTLY WHAT I TYPED. Naturally, the casing is wrong in the instructions and no one seems to care to update them. C'mon guys! Shouldn't this be mentioned as part of the damn steps? Without being on the repo's dev branch and having NuGet configured you'll end up wasting a day swearing at the top of my lungs because I missed the second paragraph of the intro, having dived straight into the ordered bulletted list of steps.. sheesh!

In addition, be more clear when saying where said NuGet config file should be placed. It resides in your project's root NOT the web root. Like where your usual solution (.sln) file lives in a standard MVC project relative to your webroot.

ozmartian avatar Mar 21 '15 13:03 ozmartian

@ozmartian First I shall apologize because I know this post is going to be taken the wrong way, and most likely completely out of context. But if you have figured out the problem, and can see a nice fix (as in, documentation) make a PR and attempt to fix it, this is an open source project, open source project appreciate fixes, actually expects them. Worst that can happen, it is rejected, but the discussion will start.

tenowg avatar Mar 22 '15 03:03 tenowg