简体   繁体   English

VS 2015 MVC6参考/相关性错误

[英]VS 2015 MVC6 references/dependencies errors

I just upgraded my VS 2015 RC to the final version from MSDN. 我刚刚将VS 2015 RC从MSDN升级到最终版本。 Then I tried adding a new project, an MVC 6 project. 然后,我尝试添加一个新项目,即MVC 6项目。

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. -没错,正如您从下面的屏幕截图中可以看到的那样,Core和DNX的大多数参考都标有黄色错误三角形。

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. 除了“ WindowsAzure.Storage”引用之外,我想我添加了一个引用,但是一个或多个引用没有什么区别,我只是想看看通过nuGet管理器添加的引用是否可以更好地工作,但是它们别。

大多数参考都直接显示错误

Not sure if it will help, but here is a copy of the default project.json from the project in question: 不确定是否会有所帮助,但这是有问题的项目的默认project.json的副本:

{
  "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" ]
  }
}

It seems to me either the new DNVM is not installed properly or the DNX core is missing. 在我看来,要么新的DNVM未正确安装,要么DNX核心丢失。 Try opening up a powershell window and type dnvm . 尝试打开一个dnvm窗口,然后键入dnvm You should see something like this: 您应该会看到以下内容:

在此处输入图片说明

Also, make sure you have the beta-5 DNX installed. 另外,请确保已安装beta-5 DNX。 You can check this by typing dnvm -list and you should get something along the lines of the lower part of this image: 您可以通过键入dnvm -list进行检查,并且应该在该图像的下部获得一些信息:

在此处输入图片说明

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. DNVM运行时应随Visual Studio 2015中的Web一起提供。如果您尚未安装DNVM,则我认为您将无法为新解决方案执行文件>新项目。

If you installed an older version of VS2015, maybe you got an older version of the DNX core and you need to upgrade. 如果安装了VS2015的旧版本,则可能是DNX核心的旧版本,需要升级。 Use the dnvm upgrade command for this. dnvm upgrade请使用dnvm upgrade命令。

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 有关安装DNVM的更多信息: http ://docs.asp.net/zh/latest/getting-started/installing-on-windows.html要安装新的DNX, 请访问http : //www.codeproject.com/Articles/1005145/ DNVM-DNX和DNU了解ASP-NET运行时

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. 我确实建议您了解DNVM和DNX的含义和作用,因为如果您想进行vNext的工作就很重要。

Let me know if you need more help! 让我知道您是否需要更多帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM