Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2015 MVC6 references/dependencies errors

I just upgraded my VS 2015 RC to the final version from MSDN. Then I tried adding a new project, an MVC 6 project.

But nothing works, and the error list is empty. If I try to build, it just seems to wait forever, and eventually I have to cancel the build process - no errors atall, it just doesn't build. - And rightfully so, since as you can see from the screenshot below, most of the references for both Core and DNX are marked with yellow error triangles.

But at least I would have liked some kind of error message or other hint on how to fix this.

I have made zero changes to the project, so it should have worked out of the box. Except maybe the "WindowsAzure.Storage" reference, I think I added that one, but one more or less doesn't make any difference, I just wanted to see if any references I added myself via the nuGet manager would work better, but they don't.

Most references show errors right out of the box

Not sure if it will help, but here is a copy of the default project.json from the project in question:

{
  "webroot": "wwwroot",
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
    "Microsoft.AspNet.Mvc": "6.0.0-beta5",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta5",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta5",
    "Microsoft.Framework.Logging": "1.0.0-beta5",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta5",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta5",
    "WindowsAzure.Storage": "4.4.1-preview"
  },

  "commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  },

  "exclude": [
    "wwwroot",
    "node_modules",
    "bower_components"
  ],
  "publishExclude": [
    "node_modules",
    "bower_components",
    "**.xproj",
    "**.user",
    "**.vspscc"
  ],
  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
  }
}
like image 263
Gertsen Avatar asked Jul 29 '15 06:07

Gertsen


1 Answers

It seems to me either the new DNVM is not installed properly or the DNX core is missing. Try opening up a powershell window and type dnvm. You should see something like this:

enter image description here

Also, make sure you have the beta-5 DNX installed. You can check this by typing dnvm -list and you should get something along the lines of the lower part of this image:

enter image description here

The DNVM runtime should come with the web stuff in Visual Studio 2015. If you hadn't installed that, I don't think you would have been able to do file > new project for a new solution.

If you installed an older version of VS2015, maybe you got an older version of the DNX core and you need to upgrade. Use the dnvm upgrade command for this.

More info on installing DNVM: http://docs.asp.net/en/latest/getting-started/installing-on-windows.html For installing new DNX's: http://www.codeproject.com/Articles/1005145/DNVM-DNX-and-DNU-Understanding-the-ASP-NET-Runtime

I hope this helps. I do recommend you get an idea of what DNVM and DNX mean and do, since it's going to be important if you want to do vNext stuff.

Let me know if you need more help!

like image 145
Jochen van Wylick Avatar answered Oct 30 '22 16:10

Jochen van Wylick