eddpoints
eddpoints

Reputation: 193

dnu restore from from Visual Studio 2015 Update 1 RC

Whenever I modify packages through the project.json file my references area says "Errors - see Error List". The error list will say "Dependencies in project.json were modified. Please run "dnu restore" to generate a new lock file.

In there a way to do this from within Visual Studio? I am having to load the Developer Command Prompt for 2015 and cd to the project directory and run the command through there,

If I right click on the references and select "Restore Packages" (which sounds like it should do it) it just says the above "see Error List".

Upvotes: 13

Views: 8213

Answers (5)

ToDevAndBeyond
ToDevAndBeyond

Reputation: 1503

I was able to use the dnu restore command from inside visual studio by going through tools>package manager console. I deleted all the dnx packages before restoring by going to C:\Users\name\.dnx\packages

Upvotes: 2

Brett.J
Brett.J

Reputation: 91

I had the same issue as you. What I did was the following:

Open a command prompt as Administrator. Change directory to your .dnx folder, Mine was in C:\Users\MyUserName\ .dnx\runtimes\dnx version{rc1-final in my case}\bin\

Your going to run dnu restore against your project.json file in your project. My command looked like this. dnu restore C:\Dev\Projects\ExampleProject\project.json

It will download and restore all the dependencies and you should be good to go. Hope this helps!

Upvotes: 9

Ivan Zub
Ivan Zub

Reputation: 805

I had the similar issue after upgrading to VS 2015 Update 1. VS was thinking that my run-time version was RC1, but DNVM (.NET Version Manager) had no clue about it. So when I was publishing the solution it was using beta nuget packages, configuration for drop folders, builds and so on.

So what I've done is:

dnvm list

To show me the list of available runtimes. Mine was looking like that:

Active Version           Runtime Architecture OperatingSystem Alias
------ -------           ------- ------------ --------------- -----
       1.0.0-beta5       clr     x64          win
       1.0.0-beta5       clr     x86          win
       1.0.0-beta5       coreclr x64          win
       1.0.0-beta5       coreclr x86          win
  *    1.0.0-beta7       clr     x86          win             default

After that I've upgraded DNVM to the latest version via:

dnvm update-self

And installed the latest stable version of runtime:

dnvm upgrade

It will also set the latest runtime as default for your environment. After the upgrade you should get the following version list:

Active Version           Runtime Architecture OperatingSystem Alias
------ -------           ------- ------------ --------------- -----
       1.0.0-beta5       clr     x64          win
       1.0.0-beta5       clr     x86          win
       1.0.0-beta5       coreclr x64          win
       1.0.0-beta5       coreclr x86          win
       1.0.0-beta7       clr     x86          win
       1.0.0-rc1-update1 clr     x64          win
  *    1.0.0-rc1-update1 clr     x86          win             default
       1.0.0-rc1-update1 coreclr x64          win
       1.0.0-rc1-update1 coreclr x86          win

Hope that helps.

Upvotes: 3

Ilya Chernomordik
Ilya Chernomordik

Reputation: 30335

I have found the real solution that fixed the issue (at least for me). What happens is that the "dnu restore" is apparently linked to Nuget, even if you referencing your own project in the same solution. So actually instead of doing "dnu restore" you can just right click on solution/references and chose restore packages. That does the trick.

To make that happen automatically you need to go to Tools->Options-> NuGet Package Manager and check "Allow download missing packages" and "Automatically check on build". The last one seems to be weird because you don't build, but that what triggers VS to restore the packages properly.

Upvotes: 16

eddpoints
eddpoints

Reputation: 193

The blog post where I downloaded stated that the Tooling would be automatically installed when installed Update 1, this however had not happened and I had to manually download the ASPNET 5 tooling and install it. Then it managed to resolve from the menu and building the project actually worked. I was updating from Beta5 to RC1.

Upvotes: 2

Related Questions