如何创建基于 .NET Core 而不是完整框架的 ASP.NET 项目? [英] How do I create a ASP.NET project based on the .NET Core, not on the full Framework?

查看:26
本文介绍了如何创建基于 .NET Core 而不是完整框架的 ASP.NET 项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在听说 .NET Core 几个月后,我一直在阅读有关 .NET Core 的所有内容.我有 Visual Studio 2015,所以我想我会尝试一下.我进入 File - New Project,选择 ASP.NET Web Application,然后看到我只能选择完整的 .NET Framework 版本(例如 4.6).如何创建基于 .NET Core 而不是完整框架的 ASP.NET 项目?

I was reading all about .NET Core after hearing about it for months. I got Visual Studio 2015, so I thought I would try it out. I go into File - New Project, choose ASP.NET Web Application, and see I can only choose a version of the full .NET Framework (such as 4.6). How do I create a ASP.NET project based on the .NET Core, not on the full Framework?

我以为会有 一些教程关于这个,但我找不到.我所看到的都是基于完整的框架.

I thought there would be some tutorials on this, but I can't find any. All I see is based on the full Framework.

推荐答案

ASP.NET 5.0 Core beta5 随 VS 2015 RTM 一起提供.Beta6 刚刚发布,用于升级 VS 2015.(阅读安装说明!)

ASP.NET 5.0 Core beta5 shipped with VS 2015 RTM. Beta6 just shipped and be used to upgrade VS 2015. (Read the Install Instructions!)

当您从 ASP.NET 5 预览模板(空、Web API 或 Web 应用程序)之一创建项目时,它被设置为每次编译 Core 和 4.5.1 Framework 版本构建时间.

When you create a project from one of the ASP.NET 5 Preview Templates (Empty, Web API, or Web Application) it is set up to compile both Core and 4.5.1 Framework versions every time you build.

要将其更改为仅构建核心,请执行以下操作:

To change this to build only Core, do the following:

  • 项目/属性/应用程序:从 .NET 更改平台.NET Core 框架
  • 打开 project.json 并找到框架"部分.删除dnx451":{},然后保存.
  • 构建

您现在正在 CoreCLR 上运行.

You are now running on the CoreCLR.

这篇关于如何创建基于 .NET Core 而不是完整框架的 ASP.NET 项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆