dnu restore from from Visual Studio 2015 Update 1 RC
Asked Answered
F

5

13

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".

Furtek answered 25/11, 2015 at 22:19 Comment(2)
Did you find a way to do it apart from the command line? This is really weird one of the most common functionality does not work...Sacrilege
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.Furtek
F
2

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.

Furtek answered 17/12, 2015 at 21:42 Comment(3)
I have installed an asp.net rc update 1 (separate installer), do I need to install something else as well? Where do you get this special tooling?Sacrilege
I downloaded it from here: link but the specific tooling download is now gone. It should have been installed with the Update 1 but for some reason did not. I recently reinstalled VS2015 but did not have the same issue.Furtek
On our Visual Studio 2015 Enterprise Update 1, we had the similar issue that was resolved by: "right click on the references and select "Restore Packages"Golgi
S
16

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.

Sacrilege answered 18/12, 2015 at 8:13 Comment(0)
A
9

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!

Alfreda answered 4/12, 2015 at 16:46 Comment(1)
I have used clr x64 for that purpose and it did the trick indeed. Does it matter which runtime you use, or they will all generate this project.lock file properly? Do you know of any alternatives to that fancy procedure (it's for sure a bug...?Sacrilege
M
3

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.

Middle answered 18/12, 2015 at 8:35 Comment(0)
F
2

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.

Furtek answered 17/12, 2015 at 21:42 Comment(3)
I have installed an asp.net rc update 1 (separate installer), do I need to install something else as well? Where do you get this special tooling?Sacrilege
I downloaded it from here: link but the specific tooling download is now gone. It should have been installed with the Update 1 but for some reason did not. I recently reinstalled VS2015 but did not have the same issue.Furtek
On our Visual Studio 2015 Enterprise Update 1, we had the similar issue that was resolved by: "right click on the references and select "Restore Packages"Golgi
D
2

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

Dictatorial answered 29/3, 2016 at 21:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.