17

I'm using Visual Studio 2015 Enterprise Edition and created simple Asp.net5 application. When I try to debug I'm getting this error.

The Dnx Runtime package needs to be installed. See output window for more details

Here are my project settings:

Solution DNX SDK Version : 1.0.0-beta5,
Platform : .NET Core
Architecture : x64 

(Tried with x86 as well)

Also followed the steps mentioned in this link but they didn't help.

Tried reinstalling VS2015 as well, but no luck. Any idea what I'm missing?

Shri
  • 834
  • 1
  • 12
  • 36
Sai
  • 1,376
  • 2
  • 15
  • 25

7 Answers7

25

Run it from the NuGet console (in VS 2015: Tools > NuGet Package Manager > Package Manager Console)

dnvm upgrade
dnvm upgrade -r CoreClr
Pooven
  • 1,744
  • 1
  • 25
  • 44
Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
  • 1
    I tried it victor, getting the same error. did system restart as well. Able to see the latest version. Still no luck. – Sai Aug 13 '15 at 06:59
  • I got installed Win7 from scratch with PowerShell v4, VS 2015 Enterprise Edition and got this error. This helped for me. Thanks! – LetMeCodeThis Aug 14 '15 at 19:15
  • I created new project and copied the old files. After following steps mentioned in my link and finally these 2 steps helped me fixed this issue. – Sai Aug 18 '15 at 00:24
  • Can this be run inside VS2015 somehow? – Joe Phillips Aug 18 '15 at 22:00
  • 4
    Yes, run it from the NuGet console – Victor Hurdugaci Aug 19 '15 at 05:19
  • Could you point us to any documentation explaining what's going on with these commands? – Mark Meuer Oct 09 '15 at 22:21
  • 11
    When running the last command I just get `A positional parameter could not be found that accepts 'CoreClr'. – Douglas Gaskell Nov 16 '15 at 07:17
  • 2
    The solution is to use the .NET Version Manager (dnvm) command line tool to install the correct version of framework. My problem was that I had rc1 installed on my machine, but the online project templates still used beta5. This article describes how to install frameworks using the command line: http://www.codeproject.com/Articles/1005145/DNVM-DNX-and-DNU-Understanding-the-ASP-NET-Runtime – Timothy Klenke Nov 30 '15 at 17:28
  • I had the same problem and it fixed after updating the version number in global.json. Thanks @TimothyKlenke – Bahman May 08 '16 at 00:59
  • Ran both but still got the error. After restarting Visual Studio the solution built successfully. Thanks! – hatsrumandcode Dec 13 '16 at 17:15
10

I got this error when I selected the Class Library (Package) project type from the Templates > Visual Studio C# > Web template structure (see image).

Class Library in Web template folder

What I really wanted was the "Class Library" which has the description "A project for creating a C# class library (.dll)". When I created a new project under this type, I did not get this error.

P Walker
  • 532
  • 5
  • 15
10

Found the solution at last !,

First run the command,

dnvm upgrade

if this command fails, with errors like the process is being used, run it again. And it will work after a few tries, i think the lock is due to some retires VS is doing to install the DNU properly. After this command run,

dnvm upgrade -r CoreClr

this command should restore your Core packages. It worked for me on some projects.

But if even after this the project is showing the same error, then close Visual Studio, reopen it and you will notice that the references are not loading. And it will ask your to look at the error list, which is good as once you look at the 35 odd errors, one of them give you a command to run, Run this command,

dnu restore

These three commands should get your project building.

C B
  • 1,964
  • 14
  • 13
  • doesn't work for me.. unclear. possibly DNVM runs into errors but I'm about to give up... :( – Efrain Apr 13 '16 at 13:50
4

I believe this is the same as a known issue and relates to not having the correct version of power shell installed. You can see the solution that helped me here

Community
  • 1
  • 1
Tom
  • 603
  • 1
  • 6
  • 17
3

I tried accepted answer but no avail. I solved by typing below script in command prompt.

dnvm install 1.0.0-rc1-update1 -f

And I reloaded project and the problem solved.

Robert
  • 5,278
  • 43
  • 65
  • 115
Epikem
  • 99
  • 2
  • 6
0

I have met with same issue and here I found the solution.To begin with you need an internet connection and visit the this link:

http://www.codeproject.com/Tips/1039152/DNX-SDK-Version-dnx-clr-win-x-beta-Failedto

First of all,you need to set the path in Environment Variables for Powershell , example:

C:\Windows\System32\Windows PowerShell\1.0

And then enter the following comments mentioned in the website..in Command Prompt(cmd.exe).

Mi-Creativity
  • 9,554
  • 10
  • 38
  • 47
Mohd Anzal
  • 157
  • 8
0

You need to update powershell tools for vs.

Tools -> Extensions and Updates -> Updates -> Visual Studio Gallery -> PowerShell Tools for Visual Studio 2015

Jhonattan
  • 492
  • 5
  • 14