如何在 ASP.NET 5 MVC 6 项目中切换到完整的 .NET 堆栈

How to switch to full .NET stack in ASP.NET 5 MVC 6 project

我在 VS 2015 中创建了一个新的 ASP.NET 5 MVC 6 (vNext) 项目。

我从另一个项目导入了一些 类,但看起来 DNX 缺少一些对我来说非常重要的 类。

我可以选择使用完整的 .NET 堆栈而不是 DNX 吗?
我必须改变什么?与旧方法相比,我更喜欢新的 config.json 文件,但是我必须将引用更改为什么。

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

你只需要删除核心线,如:

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

来自asp 5 docs(突出显示的相关部分):

dnx451 represents the .NET Framework, while dnxcore50 represents .NET Core 5 (5.0).

...

The recommendation from the ASP.NET team is to target both frameworks with new applications. If you want to only target .NET Core, remove dnx451, or only target .NET Framework, remove dnxcore50, from the frameworks listed in project.json. Note that ASP.NET 4.6 and earlier target and require the .NET Framework, as they always have.