4imble
4imble

Reputation: 14426

ASP.NET vNext package restore not working

I checked in my new vNext project into TFS at home and it was working fine.

I then went to work (corporate environment with proxy etc) and get latest. It pulled my project down and i fired up the solution.

I do a build and it's failing. The reason being that it is not restoring my nuget packages.

I can view the packages in nuget fine, I also get the nice intellisense in the .json file too. This makes me think it's not a proxy issue.

None of these things have worked. Any other ideas?

Addendum

project.json

{
    "webroot": "wwwroot",
    "version": "1.0.0-*",
    "exclude": [
        "wwwroot"
    ],
    "packExclude": [
        "node_modules",
        "bower_components",
        "**.kproj",
        "**.user",
        "**.vspscc"
    ],
    "dependencies": {
        "Microsoft.AspNet.Server.IIS": "1.0.0-beta2",
        "Microsoft.AspNet.Mvc": "6.0.0.0-beta2"
    },
    "frameworks": {
        "aspnet50": { },
        "aspnetcore50": { }
    }
}

enter image description here

Upvotes: 2

Views: 2529

Answers (3)

Ruben Chavarri
Ruben Chavarri

Reputation: 1

I´m developing with beta8, and I had to jump a few times between beta versions and the best solutions that works for me was to add new feeds for VNext packages:

  • www.myget.org/F/aspnetmaster/api/v2/ This feed contains the release version of the packages for each milestone, for example, 1.0.0-alpha4.
  • www.myget.org/F/aspnetvnext/api/v2/ This feed contains the nightly dev packages with build numbers, for example, 1.0.0-beta1-10435.

After updating the new feeds, I open and save my project file “project.json” and the references updates itself.

Take a look the next article if you need to know how to add this new feed on your Windows or *Nix machines: https://github.com/aspnet/Home/wiki/Configuring-the-feed-used-by-dnu-to-restore-packages

A very useful although general article about how dnx project in: http://docs.asp.net/en/latest/dnx/projects.html

Upvotes: 0

GitteTitter
GitteTitter

Reputation: 434

I got a similar problem while restoring packages when there was an unreachable server address in my nuget package sources. In that case unchecking the unreachable server in my package sources did the trick.

This behavior seems like a bug to me. It keeps failing on the one unreachable server and fails to try and restore the packages with the other, official nuget server. This also results in a failing restore of bower packages.

Upvotes: 0

4imble
4imble

Reputation: 14426

Okay i got it working, many thanks to @Victor Hurdugaci for helping me out.

Steps for me to fix this were as follows:-

  • Add kpm to path, for me i found it here: C:\Users\MyUser\.kre\packages\KRE-CLR-x86.1.0.0-beta2\bin (you might want to check your project properties to see which version you need, im not sure it matters)
  • open up a cmd (make sure this was closed before adding to path)
  • cd to your project folder (the location of your project.json)
  • run kpm restore -p http:yourproxyurl:1234 (where yourproxyurl is your proxy address and 1234 is your port)

At this point it did loads of downloading goodness into C:\Users\MyUser\.kpm\packages I went back into Visual studio and did a build, it was still failing.

As a final step I had to open the project.json file and simply save it without even making any changes. At this point my references updated and all was good, it would then build successfully.

Upvotes: 3

Related Questions